Skip to content

PR C: reconcile count surfaces and WAL isolation - #169

Merged
ohjonathan merged 1 commit into
mainfrom
codex/audit-tail-consistency
Jul 14, 2026
Merged

PR C: reconcile count surfaces and WAL isolation#169
ohjonathan merged 1 commit into
mainfrom
codex/audit-tail-consistency

Conversation

@ohjonathan

Copy link
Copy Markdown
Owner

Summary

Reconciles the four D1b-counts findings from the independently verified PR B baseline f2ed48d, and deterministically retires the accepted portfolio WAL/SHM flake.

  • centralizes concept vocabulary loading for map, activation/doctor, snapshots, and MCP;
  • threads configured max_dependency_depth (including zero) through snapshots and MCP context_map;
  • excludes the configured generated context map once in scoped document collection;
  • makes maintain check_links use the same body-aware diagnostics as link-check;
  • closes every portfolio SQLite connection on success, failure, and setup exceptions;
  • routes activation through the semantic no-op map writer.

Package metadata remains 5.0.0. Tags, publication, merge, and release actions are maintainer-owned.

Closes no issue. Implements the four remaining count rows in #148 for review.

Before / after count matrix

Controlled fixtures isolate one counted concept at a time. N/A means that surface does not expose that diagnostic class.

Finding / fixture map activate doctor link-check maintain MCP snapshot / map
D1b-counts-1, one unknown concept 1 → 1 curation warning 0 → 1 0 → 1 N/A N/A 0 → 1
D1b-counts-2, depth-8 chain, max 10 0 → 0 depth warnings 0 → 0 0 → 0 N/A N/A 3 → 0
D1b-counts-3, 2 docs + generated map 2 docs / 0 map-orphans → same 2 / 0 → same docs 3 → 2; activation 2 / 0 → same 3 / 1 → 2 / 0 2 / 0 → same 3 / 1 → 2 / 0
D1b-counts-4, broken body wikilink N/A N/A N/A 1 → 1, exit 1 0 / success → 1 / failure N/A

The concept reconciliation is validation-on. The default docs scope remains clean at 219 documents, 0 errors, and 0 warnings. Non-default library scope deliberately changes from 576 to 1,450 warnings because it now includes the same 874 vocabulary findings already reported by map; no golden or tripwire was silently rebaselined.

Verification

  • focused PR C suite: 229 passed
  • complete suite: 1,600 passed
  • post-review affected suite: 114 passed
  • exact doctor phase-4 tripwire: green
  • WAL order proof: forward, reverse, and isolated target each passed 3 consecutive runs with ResourceWarning and unraisable warnings promoted to errors
  • independent WAL review: 5 forward + 5 reverse runs, 510 tests, all green
  • Ontos map/activate/doctor/link checks: green; activation remained 0/0 and semantic no-op reported refreshed=false
  • llm-dev manifest conformance: 4/4 checks passed
  • compileall, git diff --check, forbidden-scope check, and clean worktree: green

Residual risk / sequencing

The library-scope vocabulary increase is deliberate and documented. PR D remains responsible for D4a-config-1/3/5, R2-testpypi-provenance-1, and the 15/20 consolidation reconciliation. Breaking D5b-dead-code-3 remains deferred to v6.0.0.

Please keep this draft until maintainer and independent Claude review complete.

Copy link
Copy Markdown
Owner Author

Publication gate update for head 64285cd08a7c587df588ac6652af1eb2a95ba9f6:

  • CI: 6/6 green — Python 3.9, 3.10, 3.11, 3.12, non-editable install, and v5 release gates.
  • Local: 229 focused + 1,600 full-suite + 114 post-review tests green.
  • Independent code review found no remaining blockers; independent WAL review passed five forward and five reverse order runs (510 tests) with resource warnings fatal.
  • Worktree is clean and matches the pushed head.

Release actions remain maintainer-deferred. Stopping here for maintainer/Claude review before PR D.

@ohjonathan

Copy link
Copy Markdown
Owner Author

PR C review — Claude — approve to merge (no blockers, no majors)

Verified independently in a worktree at the PR head (64285cd). This was the subtlest sweep PR — the risk was reconciling counts upward into the clean activate/doctor path and reddening the passed == 12 activation tripwire. That didn't happen.

Single source of truth — not per-command patching

  • New shared io/concepts.py (load_known_concepts) that map/activate/doctor and the MCP snapshot all call.
  • The generated-map exclusion moved into the shared collect_scoped_documents, so every sibling drops it consistently (and maintain/activate no longer carry their own skip-patterns for it).
  • io/snapshot.py now threads max_dependency_depth + known_concepts into its validator, so MCP/cache counts share the exact CLI settings.
  • A new test_health_count_consistency.py (+176) locks the cross-sibling agreement in place.

The tripwire risk (D1b-1) was handled safely

run_activation now runs the same concept check as map, but on a clean repo it adds nothing. Verified live: map/activate/doctor all report 0 concept warnings and agree; activate/doctor exit 0; test_doctor_phase4 passes. The report's 0→1 / 874 figures are demonstration-fixture / library-scope numbers, not the clean default path.

The other three

  • D1b-2 — snapshot honors the configured depth → MCP's 3 phantom depth warnings go to 0, matching the CLI. Downward, tripwire-safe.
  • D1b-3 — generated map excluded everywhere (orphan 1→0), reconciled downward.
  • D1b-4maintain flipped include_body=False→True, so it checks body refs like link-check. On this (link-clean) repo both agree at 0; on a repo with a broken body ref both now surface it.

WAL flake — genuinely fixed, not papered

An autouse fixture that scopes each index to tmp_path and asserts no -wal/-shm sidecars leak at teardown, plus sqlite3.connect(...)closing(...) at the root cause. No xfail/skip/retry. Ran the full tests/mcp/ suite (286 tests) 3× — all green.

CI 6/6 (incl. 3.12); 140+ focused + the new consistency/snapshot/cache/scan-scope tests pass; ledger + #148 checkboxes reconciled and the WAL tail retired.

One out-of-scope observation (not a blocker)

ontos maintain exits 5 on the actual repo (promote_check: Document load failed, decision_history.md missing History Ledger table, archive failures). Confirmed pre-existing — base f2ed48d exits 5 with identical errors, so it is not a PR C regression. Worth its own fix, tracked separately.

Verdict: no blockers, no majors — ready to merge as a v5.0.1-track patch. Release actions remain maintainer-deferred.

@ohjonathan
ohjonathan marked this pull request as ready for review July 14, 2026 06:57
@ohjonathan
ohjonathan merged commit 8207806 into main Jul 14, 2026
6 checks passed
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