Skip to content

docs: ~ after sudo expands as the caller — six verification commands read the wrong home (C-343) - #498

Merged
Polichinel merged 1 commit into
developmentfrom
docs/tilde-expands-as-the-caller
Oct 16, 2026
Merged

Polichinel merged 1 commit into
developmentfrom
docs/tilde-expands-as-the-caller

Conversation

@Polichinel

Copy link
Copy Markdown
Contributor

Found by actually running the thing

v1.14.0 is deployed. The operator ran the corrected procedure on the host, and it worked — but step 4's first verification command did not:

$ sudo -u views-deploy cat ~/.views-deploy-tag
cat: /home/simmaa_prio/.views-deploy-tag: Permission denied

~ is expanded by the calling shell, before sudo runs. So the command reads the operator's home, not views-deploy's. Six such commands were live in the guides, and two of them were added by #497 — the PR that corrected C-343 three days ago.

One of the six failed green

sudo -u views-deploy cat ~/.../pipeline_failure.json 2>/dev/null || echo "No recent failure"

The || sat outside bash -c. A permission error on the wrong home directory therefore printed "No recent failure" — in the command an operator runs to ask whether the last pipeline run broke. That is the mechanisms that fail green cluster, in the one place where the failure is reported as its own absence. The fallback now sits inside the quoted command.

Changes

  • All six wrapped in bash -c '...', so the inner shell expands ~ as the target user. Both the deploy §step 4 block and §"Check status" carry a comment saying why.
  • Step 4's third check drops the escaped-quote python -c one-liner for ls ~/views-datafactory/.venv/lib/python*/site-packages | grep views_datafactory. No quoting to mangle, and it prints views_datafactory-1.14.0.dist-info — the same evidence form C-343 used in August (views_frames-1.0.0.dist-info).
  • C-343 updated with the deploy outcome and this defect.

The deploy itself, for the record

Check Evidence
checked-out tag HEAD is now at 2b22a64 — and v1.14.0 is 2b22a64; previous HEAD 10c4d24 is exactly v1.13.0
installed version uv sync: - views-datafactory==1.13.0 → + views-datafactory==1.14.0
tag file not yet read — the command was broken; re-run pending

The uv sync line is the part worth keeping: direct confirmation on the production host that step 3 is load-bearing. Writing the tag file alone would have left 1.13.0 installed, which is precisely what C-343 describes and what this epic kept failing to say in writing.

What this does not fix

C-343 is on its third round of correction. Each round fixed the written procedure; the instrument that would catch a fourth is still #424 and still unbuilt. A documented verification step nobody has executed is not evidence — this one had been in §"Check status" since before C-343 existed, and only broke in public when someone finally ran it.

Verified: ruff check . clean · validate_docs.sh PASSED · 48 register-reading and citation tests passed. Docs and register only; no source, test or dependency changes.

Refs #424. C-343 stays open.

🤖 Generated with Claude Code

https://claude.ai/code/session_01EfeuULbPTqrx4qtNki5dy9

…s read the wrong home (C-343)

Found by running the corrected deploy procedure on the production host.
v1.14.0 deployed cleanly, then step 4's first check failed:

    $ sudo -u views-deploy cat ~/.views-deploy-tag
    cat: /home/simmaa_prio/.views-deploy-tag: Permission denied

The calling shell expands `~` before sudo runs, so the command reads the
operator's home rather than views-deploy's. Six such commands were live
in the guides; two were added by the C-343 correction in #497. All are
now wrapped in `bash -c '...'`, where the inner shell expands `~` as the
target user.

One of the six failed green rather than loud:

    sudo -u views-deploy cat ~/.../pipeline_failure.json 2>/dev/null \
        || echo "No recent failure"

The `||` sat outside `bash -c`, so a permission error on the wrong home
printed "No recent failure" — in the command an operator runs to ask
whether the last pipeline run broke. The fallback is now inside the
quoted command.

Step 4's third check also drops the escaped-quote python one-liner for
`ls .venv/.../site-packages | grep views_datafactory`, which needs no
quoting and prints the dist-info directory — the same evidence form
C-343 used in August.

C-343 updated with the deploy outcome: `uv sync` reported
1.13.0 -> 1.14.0 on the box, which is direct confirmation that step 3 is
load-bearing and the tag file alone would have left 1.13.0 installed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EfeuULbPTqrx4qtNki5dy9
@Polichinel
Polichinel enabled auto-merge (squash) October 16, 2026 14:25
@Polichinel
Polichinel merged commit 4a935a3 into development Oct 16, 2026
6 checks passed
@Polichinel
Polichinel deleted the docs/tilde-expands-as-the-caller branch October 16, 2026 14:42
Polichinel added a commit that referenced this pull request Oct 20, 2026
…ee steps (C-343) (#507)

v1.15.0 deployed with all four blocks and all three verification commands
naming the same version, so C-343's corrected procedure completed end to end
for the first time — step 4 included. That matters because on 2026-10-16 step
4's first command died on the `~`-expansion defect, meaning the verification
block added on 2026-10-13 had never once executed successfully. #498's fix is
now confirmed by execution rather than by reading.

Writing that up prompted a grep for the step COUNT rather than the step
CONTENT — a dimension none of the four previous rounds had audited. Four live
copies still said three:

  reports/technical_risk_register.md  C-343's Open Items Summary row
  reports/technical_risk_register.md  C-343's own Trigger: field
  docs/guides/hetzner_deployment_guide.md  release-ritual item 5
  scripts/refresh_pipeline.sh  header comment

Two of the four were inside the entry doing the hunting, one of them its
trigger — the field an operator is meant to act on. The summary row said
"three steps" and then listed the three checks that constitute step 4, so it
described four things while naming three.

The script comment is the sharpest. Its very next sentence reads "two copies
of a procedure drifting apart is what C-343 IS, and a fix that adds a third
copy would be the same bug" — and it had drifted, because a count is a copy
too. It carefully avoided duplicating the commands and then duplicated the
number, which was the one part that changed. The comment now records that it
said THREE until today, five weeks after the fourth block was added.

No new register entry: same entry, same mechanism, fifth round. What the round
relocates is where the mechanism hides — rounds one to four hunted copies of
the procedure and found them in guides and ADRs; this one found that the
procedure's cardinality is independently copyable.

Also recorded on the entry, because it is the same confusion one layer up: the
#501 instrumentation was merged to development and then described to the
operator as something the next cron would pick up automatically. It would not
have — the server runs a tag and v1.14.0 did not contain it. Merging the
instrumentation is not deploying the instrumentation, committed three days
after the fourth correction by whoever wrote it. Corrected on #501 before any
wait was incurred.

Left as written, per #500's precedent that a record is amended and never
rewritten to look current: C-331's narrative, ADR-022's "previously gave
deploying as three steps", and register_changelog.md's account of a past
redeploy. server_quickref.md:136's "all three checks in step 4" is correct —
step 4 does hold three commands, and four blocks whose fourth contains three
checks is a fair part of why the count drifted.

Verification: full suite EXIT=0, 0 FAILED, 0 ERROR; all 14 register-reading
test files 41 passed; ruff check . clean; mypy src/ clean (89 files);
validate_docs.sh PASSED; bash -n scripts/refresh_pipeline.sh OK.
notebooks/acled_cursor_parity.ipynb re-executed from committed fixtures with
no network: 3 slices, 106,329 events, every oracle held, 0 errors.

Refs #501.


Claude-Session: https://claude.ai/code/session_01EfeuULbPTqrx4qtNki5dy9

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant