web_probe_test.py: BeadsPageNoWorkspaceProbeTests mocks BEADS_DIR, which Amendment A1's Bd.raw ignores nf-okiy ← Beads

closed priority 2 task unassigned

Twinned from https://github.com/cfsh/ninefold/issues/1136 by tools/beads/import_github.py's reconcile pass.

Found while rebasing an unrelated PR stack onto design 011 Amendment A1 (#1122/#1126) on nf-dev-sg, 2026-08-19.

\tools/web_frontend/web_probe_test.py\'s \BeadsPageNoWorkspaceProbeTests\ (from #1121, already merged) simulates "no bd workspace" by doing:

\\\`python patcher = mock.patch.dict(os.environ, {"BEADS_DIR": self._tmpdir.name}) \\\`

Under Amendment A1, \nflib.bd.Bd.raw()\ always sets \BEADS_DIR\ itself from the resolved shared workspace path (\env = {**os.environ, "BEADS_DIR": self._beads_dir()}\) — an ambient \BEADS_DIR\ in \os.environ\ is unconditionally overwritten, never read. \notes/beads.md\ says this explicitly: "No Python call site depends on it or should." So this test's isolation strategy has no effect on the real code path anymore.

Consequence: once this box's shared reserved workspace (\~/nf/beads\) is genuinely bootstrapped and holds any data — which happened live on \nf-dev-sg\ sometime around 2026-08-19 04:59, presumably as part of \011-sync\'s #1122 rollout — this test starts reading THAT real data instead of hitting the "no workspace" degrade path it's asserting on, and fails:

\\\` AssertionError: 'bd call(s) failed while loading this page' not found in '...<p class="empty">None — no bd epics found (no workspace resolved, or nothing tracked yet).</p>...' \\\`

Reproduced twice in the same worktree; passed in a separate worktree checked out slightly earlier (before the shared workspace was populated) — consistent with the mock genuinely doing nothing and the test result depending entirely on whether \~/nf/beads/.beads\ happens to hold data at run time, not on the mock.

Fix, roughly: the test needs to make \resolve_beads_workspace()\ itself resolve to an empty directory — e.g. patching \nflib.bd.resolve_beads_workspace\ (or its callers in \server.py\) directly, or setting \NF_BEADS_WORKSPACE_ROOT\ (the override env var \beads_workspace_root\/\resolve_beads_workspace\ actually read) to the empty tmpdir instead of \BEADS_DIR\. Whoever picks this up should check whatever \server.py\'s \/beads\ handler actually calls to get its \Bd\ instance and confirm the override reaches it.

Filed unclaimed per CLAUDE.md — not part of my chunk (design 011 T7, #1041).

Dependencies

None.

Comments

No comments.

Add a comment