Skip to content

Generic-tool completeness: audit fixes, lifecycle, dashboard fidelity, CI green#11

Merged
maruwork merged 12 commits into
mainfrom
claude/serene-davinci-fd7b67
Jun 19, 2026
Merged

Generic-tool completeness: audit fixes, lifecycle, dashboard fidelity, CI green#11
maruwork merged 12 commits into
mainfrom
claude/serene-davinci-fd7b67

Conversation

@maruwork

Copy link
Copy Markdown
Owner

Summary

Multi-round audit + remediation to make ADOP complete and publication-ready as a generic tool.

  • Distribution (C1): adop.json lists adop_html.py + template_files; adop_sync copies runtime + templates and rejects manifest paths that escape --target.
  • Lifecycle (C2): new reject command (proposed/blocked/hold → reject); summary resolves a standalone reject-note as terminal.
  • Safety (C3): write-trial guard uses WRITE_TRIAL_TYPES (task/phase-scoped now need an isolated sandbox).
  • Dashboard fidelity (U1–U3, R2/R3, A1–A4): surfaces trial-packet allow/deny envelope, block reason, intake why-now, watch interest, reject reason, and deprecated/migrating/archived/hold reasoning (were blank or showed the stale promote judgment).
  • Concurrency (Windows): _acquire_lock treats PermissionError like FileExistsError so id minting retries instead of crashing under contention; stale-lock recovery; finally-cleanup never raises.
  • Scaling: summary/state resolution read judgments from one in-memory load (was ~O(n²) disk reloads).
  • Schema durability: MIN_READABLE_SCHEMA_VERSION + additive-only contract; too-new versions get a clear "upgrade adop" message.
  • Cross-project value: read-only adop aggregate --root A --root B.
  • CI/lint: ruff E501 ignored (long help/template strings) with line-length kept for ruff format; collapsed the dead relative-import branch so mypy passes (and fixed a latent key type bug it surfaced); added pytest-cov gate (fail_under=80, measured ~84%); SECURITY.md trust model; append-only correction guidance.

Verification (local)

  • ruff check ✓, ruff format --check ✓, mypy (23 files) ✓
  • pytest 196 passed; phase gate 6/6; adop lint ok (157)
  • manifest-synced runtime --version + render-html

🤖 Generated with Claude Code

maruwork and others added 12 commits June 19, 2026 18:27
- C1: add adop_html.py + HTML template to adop.json manifest; adop_sync
  now copies runtime_files + template_files so a synced runtime starts.
- C2: add `reject` command (proposed/blocked/hold -> reject); summary
  resolves a standalone reject-note to terminal `reject`.
- C3: write-trial guard uses WRITE_TRIAL_TYPES membership so task-scoped
  and phase-scoped also require an isolated write sandbox.
- U1: dashboard falls back to the trial-packet no_impact_envelope.
- U2/U3: read block_reason and intake_reason field names.
- U4: modal opens with focus on close button and traps Tab.
- C4/U5: drop wrong --deprecation-reason hints, fix sample watch id,
  reconcile reject lifecycle docs in README and design notes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…dings

- R1: adop_sync rejects manifest paths with '..' / absolute / drive-relative
  roots so apply/push cannot write outside --target.
- R2: dashboard surfaces watch-note interest_reason.
- R3: pre-trial reject shows reject_reason and no longer claims a trial ran.
- R4: scan skips files larger than 5 MB (OOM guard).
- R5: adop_sync exits cleanly on malformed adop.json / sync-registry.json.
- Orphaned-lock recovery: reclaim a write lock only when older than 30s so a
  crashed writer cannot block a fixed-id artifact forever.
- Docs: SECURITY.md Trust Model section (operator-trusted inputs, opt-in
  artifact-root boundary, trusted sync source); document `adop_sync apply`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…olicy

- Dashboard: surface retirement_reason / migration target+plan / archive
  end_date+successor / hold reason for deprecated/migrating/archived/hold lanes
  (were showing the stale promote judgment or generic text).
- Concurrency: _acquire_lock treats Windows PermissionError like FileExistsError
  so write_next_sequential_artifact retries instead of crashing under contention;
  finally-cleanup no longer raises on a contended unlink.
- Scaling: build_summary / _resolve_scene_states resolve judgments from one
  in-memory load instead of re-reading the artifact root per trial (was ~O(n^2)).
- HTML UX: Historical filter auto-opens the history section.
- Lint: ignore E501 (long help/template strings) while keeping line-length=100
  for ruff format; apply safe ruff autofixes (import order, unused imports);
  add pytest-cov coverage config; document network-FS durability limit.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Schema durability: split SCHEMA_VERSION (write) from MIN_READABLE_SCHEMA_VERSION
  (read floor); accept the inclusive range; a too-new version reports "written by
  a newer adop; upgrade" instead of generic invalid. Additive-only compat contract
  documented (no in-place migration; append-only records survive upgrades).
- Cross-project value: new read-only `adop aggregate --root A --root B [--json]`
  portfolio view (scene/tool/state per root); design note updated to match.
- Coverage: add pytest-cov gate (fail_under=80, a real floor — dual try/except
  import blocks and __main__ are structurally uncoverable); add adop_sync CLI
  tests (74%->94%). Measured total ~84%.
- Docs: README note on correcting mistakes under append-only (supersede, never edit).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
CI on the branch was red. Root cause was pre-existing lint/format debt
(carried since main fb6f167), surfaced by `pre-commit run --all-files`:

- ruff format: reflow all modules/tests to the configured width.
- ruff check: fix the residual E741/E731/E702/F401/F841 (ambiguous `l`,
  lambda->def, semicolon splits, unused import/vars).

Tests (196), phase gate (6/6), and adop lint remain green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The pre-commit `mypy` hook failed fatally with "No parent module -- cannot
perform relative import" on the `try: from . import ...` dual-import idiom:
in this flat py-modules layout the relative branch never runs (script,
pip-install, and tests all import these as top-level), so it was dead code
that only broke mypy. Collapse each module to the absolute imports that
actually execute. This also let mypy finally check adop_summary, surfacing a
real latent bug (variable `key` reused as both tuple and str) — now fixed by
renaming the str key to `note_key`.

All CI-equivalent gates pass locally: ruff check, ruff format --check,
mypy (23 files), pytest (196), phase gate (6/6), adop lint.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Long lane portfolios make the rendered dashboard scroll well past a screen;
without a back-to-top control it is awkward to return to the summary/toolbar.
Add a fixed, accessible "↑ Top" button that fades in past 400px of scroll and
smooth-scrolls to the top. Lives in the canonical template so every
`render-html` output gets it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ray files)

First-view tidy-up without breaking tooling:
- Move SECURITY/CONTRIBUTING/CODE_OF_CONDUCT/SUPPORT into .github/ (GitHub still
  recognises them there for the community profile); update the SUPPORT URL in the
  issue-template config and the README references.
- Fold pytest.ini into pyproject [tool.pytest.ini_options]; remove pytest.ini.
- Stop tracking the generated .coverage file and gitignore coverage outputs.

Tests (197), ruff, ruff format, mypy all green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…al-gap

- P1: `adop init --overlay a/b/c.md` crashed with a raw FileNotFoundError when
  the parent dir was absent. Create overlay_path.parent before writing/copying.
- P3: `adop summary` appended a comparison-time structural_gap ("workflow lacks
  a bounded evaluation lane") for every scene that ever had a comparison, even
  once it reached in-trial — self-contradictory. Gate the gap to pre-trial
  states (watch/proposed/blocked/trial-ready).

Tests added for both; ruff/format/mypy/pytest(199)/adop lint green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…tus)

The repo's first view was dominated by its own dogfooding/coupling-demo setup,
not the tool. Remove that apparatus so the published repo is just the tool:

- Delete .adop/ (157 self-adoption records) and gitignore it (runtime output,
  not source; consumer projects create their own).
- Delete coupling-demo dev surfaces: eslint.config.js, package.json,
  .prettierrc.json, .prettierignore, .markdownlint-cli2.jsonc, .trivyignore,
  renovate.json, Dockerfile.tooling-example, .vscode/.
- Delete the tool-surface-examples workflow and scripts/repo-smoke.sh.
- Drop the now-dangling npm dependabot ecosystem and the check-renovate
  pre-commit hook.
- Reset adop-overlay.md to an honest canonical-repo overlay (no fake scenes,
  no references to deleted files).

Tool behaviour, scan surface rules, tests, and CLI are unchanged.
ruff / ruff format / mypy / pytest (199) / CLI smoke all green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Restores a small "ADOP used on a real lane" illustration that the dogfooding
cleanup removed — without re-cluttering the root:

- examples/walkthrough/.adop/ holds one lint-ci lane (ruff) driven intake ->
  compare -> trial -> result+judgment -> hold, plus one coupling snapshot
  (7 lint-clean artifacts).
- examples/README.md explains the lane and the view commands.
- .gitignore now ignores only the ROOT /.adop/ so this tracked example survives
  while the canonical repo still keeps no records of its own.

examples/ is one root entry and is outside ruff/mypy/pytest/packaging scope, so
it does not affect the toolchain. ruff/format/mypy/pytest(199) green.

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