Skip to content

Give doc examples per-run output dirs; drop the phantom explorer - #317

Open
MaxGhenis wants to merge 2 commits into
mainfrom
docs/run-dir-tmp-paths
Open

MaxGhenis wants to merge 2 commits into
mainfrom
docs/run-dir-tmp-paths

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Docs only. This PR fixes two problems found on 2026-10-07 and two stale-example problems found while checking them. It changes only README.md, docs/agent-source-package-harness.md and docs/storage-architecture.md.

1. Shared /tmp output paths. The build-suite, export-db-tables and publish-derived examples sent every agent to the same fixed paths: /tmp/chronicle-suite, /tmp/chronicle-mirror and /tmp/chronicle-build-artifacts.jsonl. --replace runs shutil.rmtree on a non-empty output directory (_prepare_output_dir in chronicle/suite.py, bundle.py and mirror.py), so concurrent agents deleted or swapped each other's output. write_build_artifacts_jsonl also opens its file with "w". The fix follows #315, which gave the build-bundle examples the same pattern and is now on main:

  • Every example that starts a build opens with RUN_DIR="$(mktemp -d)" and writes under "$RUN_DIR/...". Basenames are unchanged.
  • Steps that read an earlier build's output reuse that build's $RUN_DIR, and the prose names the producing step. These are export-db-tables and publish-derived. Retire the hosted Supabase mirror and query_sources #351 retired the third, load-supabase-mirror.
  • The harness doc's report prose names each build's <output-dir>/reports and <output-dir>/reports/agent_acceptance.json, where <output-dir> is the output_dir that build-suite prints. It no longer names $RUN_DIR, because read top to bottom $RUN_DIR at that point belongs to a later per-package run.
  • --replace stays on build-suite and export-db-tables. Inside your own run directory it clears only your own earlier output, which re-running a single build line needs. The docs say so.
  • The harness doc tells agents whose shell drops variables between commands to reset RUN_DIR to the parent of the output_dir that build-suite prints. build-suite prints its report, which includes output_dir (chronicle/harness.py, BuildSuiteReport in chronicle/suite.py).
  • After this PR, git grep -n /tmp/ -- README.md docs/ finds only the two prose warnings that name /tmp/chronicle-suite as the thing not to do.
  • README: the SOI Table 1.4 example moves up next to its Table 1.1 sibling. Otherwise its fresh RUN_DIR would sit between the strict Table 1.1 build and the export that reads it.
  • README: the validate-concept-alignments example builds its own fixture facts. Before, it read a file written about 300 lines earlier.

2. README "Run Chronicle Explorer" documented an app that is not in the repo. The section is removed; on main it is section 3, so after this PR the Quick Start is "1. Install" and "2. Validate fixture facts", followed by main's "Retired legacy target tables". Where the app went:

  • No commit on any ref has an explorer/ path (git log --all -- explorer 'explorer/**' is empty).
  • The section first appears in 7a5a7b0 (2026-05-21, branch codex/source-packages-pe-parity) as "Arch Explorer" with ARCH_EXPLORER_DATA_DIRS. It reached main through Add Arch source package core harness #7, and Add Ledger governance and raw fact boundary checks #68 renamed it, all without app code.
  • Session history puts the app in an untracked explorer/ folder of one local checkout of this repo (remote PolicyEngine/arch-data, which redirects here): @cosilico/arch-explorer, a Next 16 + Tailwind 4 workbench last edited 2026-05-15. It was never pushed, and no PolicyEngine or CosilicoAI repo holds it, so the README cannot point at it.

3. Stale OBR package ids. The README and harness doc ran validate-package obr-efo-receipts, which fails with Source package not found. The registered ids are obr-efo-receipts-march-2026 and obr-efo-expenditure-march-2026.

4. Three harness examples for packages never on main. These are ons-uk-population-projections-2022, nrs-mid-year-population-estimates-2024 and nrs-vital-events-reference-tables-2024. None is registered, their only package commits (7a5a7b0, 3475f96) are not ancestors of main, and no open PR or branch registers them. The examples are removed.

Merge with main

The branch merges main at 13294b9. The conflicts all came from #351, apart from README's Explorer hunk. Each was resolved as the 2026-11-15 comment here describes:

  • main's side of every load hunk;
  • main's export wording plus this PR's $RUN_DIR note, now covering the export and the derived publish only;
  • main's storage step 4 with this PR's $RUN_DIR arguments;
  • main's old SOI Table 1.4 block dropped, since this PR moved it.

Chronicle Governance

This PR does not touch the Chronicle source-data boundary: no source package, consumer contract, schema or code changes.

Tests

At ce145b0 (2026-10-07, before the merge with main): every edited bash block was extracted and run verbatim, each in a fresh shell with RUN_DIR unset.

  • All self-contained examples exited 0.
  • All 66 per-package build-suite runs passed: 7 US, 56 UK and 3 README UK.
  • The README, harness and storage chains passed end to end. Each ran build-suite → export-db-tables → publish-derived (with --wrangler-command true, so nothing uploaded) → the then-current dry-run mirror load, and every report read valid: true.
  • Two concurrent runs of the README build-suite block each kept a complete, separate output (80 facts and a ledger.db). With the old fixed path, building cms-aca-oep-state-level after soi-table-1-1 replaced the first agent's 80 SOI facts with 153 CMS facts.
  • The strict --require-axiom-validation and validate-concept-alignments blocks need the axiom CLI and were not run.

At d82eedf (after the merge), static checks:

  • bash -n passes on all 37 bash blocks in the three docs.
  • All 70 package ids the docs pass to validate-package, build-suite, build-fixture-facts, build-source-cells and build-source-rows resolve on main.
  • Chain order: no RUN_DIR="$(mktemp -d)" sits between a producer and its consumer. README: strict build → export → publish-derived. Harness: strict build → export → publish-derived. Storage: step 2 → steps 4 and 5.
  • None of the names in tests/test_supabase_mirror_retired.py's RETIRED_SURFACE_STRINGS appears in the three docs.

An independent review at d82eedf re-runs the doc examples there.

🤖 Generated with Claude Code

The build-suite, export-db-tables, publish-derived and load-supabase-mirror
examples sent every agent to fixed shared paths (/tmp/chronicle-suite,
/tmp/chronicle-mirror, /tmp/chronicle-build-artifacts.jsonl). --replace
deletes the output directory first, so concurrent agents deleted or swapped
each other's output. Every example that starts a build now makes its own
RUN_DIR with mktemp -d, as #315 does for build-bundle, and the chained steps
reuse that run's RUN_DIR.

README section 4 documented a Chronicle Explorer app under explorer/ that no
commit of this repo has ever contained; it is removed.

The OBR examples now use the registered package ids
(obr-efo-{receipts,expenditure}-march-2026), and three harness examples for
packages never registered on main are removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MaxGhenis

Copy link
Copy Markdown
Contributor Author

Heads-up from #351, which retires chronicle load-supabase-mirror: its default schema does not exist in the configured project, and nothing reads a hosted copy. This PR and #351 conflict in README, docs/agent-source-package-harness.md and docs/storage-architecture.md.

Whichever merges second should:

  • drop the load-supabase-mirror blocks and the storage-architecture step 6 (Retire the hosted Supabase mirror and query_sources #351 deletes them);
  • keep this PR's $RUN_DIR edits to the export-db-tables and publish-derived examples and to step 4;
  • reword "this step and the two after it", since the load step is gone.

tests/test_supabase_mirror_retired.py in #351 fails if a doc still names the command.

@MaxGhenis

Copy link
Copy Markdown
Contributor Author

#351 landed on main and removed chronicle load-supabase-mirror. Merging main into this branch now conflicts in README, docs/agent-source-package-harness.md and docs/storage-architecture.md. Apart from README's Explorer hunk, every conflict comes from #351.

  • In each file, take main's side of the load hunk. That drops this PR's load-supabase-mirror commands, README's supabase/migrations/20260504_chronicle_bronze.sql sentence and the harness doc's POLICYENGINE_SUPABASE_URL sentence.
  • In the export hunks, keep main's sentence and add this PR's $RUN_DIR note. With the load gone, the note covers the export and the derived publish only: "This step and the next" in README, and no "mirror load" in the harness doc. In the storage doc, add this PR's $RUN_DIR arguments to main's step 4.
  • README's export hunk also carries main's old SOI Table 1.4 block. This PR moved that block up, so drop it here.

Git merges this PR's $RUN_DIR export and publish-derived examples without a conflict. tests/test_supabase_mirror_retired.py fails on any live doc that names load-supabase-mirror, 20260504_chronicle_bronze, POLICYENGINE_SUPABASE_URL or five other retired names.

Resolves the conflicts with #351, which retired load-supabase-mirror. It takes
main's side of each load hunk and keeps this PR's $RUN_DIR arguments on
export-db-tables and publish-derived, so the chained note now covers those two
steps only. It drops main's old SOI Table 1.4 block, because this PR moved that
block next to Table 1.1, and keeps the Explorer section removed.

The harness report prose now names each build's <output-dir>/reports and
<output-dir>/reports/agent_acceptance.json. `<output-dir>` is the output_dir
that build-suite prints. Read top to bottom, $RUN_DIR at that point names a
later per-package run, as the round-2 review found.

Co-Authored-By: Claude Opus 5.5 <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