Skip to content

docs: bring the root documentation in line with the shipped product (#950) - #1071

Merged
frankbria merged 2 commits into
mainfrom
fix/950-root-docs
Aug 3, 2026
Merged

docs: bring the root documentation in line with the shipped product (#950)#1071
frankbria merged 2 commits into
mainfrom
fix/950-root-docs

Conversation

@frankbria

Copy link
Copy Markdown
Owner

Closes #950.

The files a first-time user or contributor opens described something that does not exist.

CONTRIBUTING.md taught a dead auth model (AC1)

It documented get_current_user, db.user_has_project_access() and /api/projects/{id}none of which are in the codebase — and linked four paths that are not either: docs/architecture/, docs/authentication.md, codeframe/providers/base.py, codeframe/tasks/test_runner.py.

Rewritten around what actually enforces auth today:

The provider and adapter sections now point at codeframe/adapters/llm/base.py and codeframe/core/adapters/agent_adapter.py, which exist.

The README contradicted itself (AC2)

PROVE and SHIP listed as pending exactly what the Web UI section listed as shipped. A reader cannot tell which half is true.

Checked each against the code before flipping it:

Roadmap line Proof it shipped
Run gates from the web UI components/proof/GateRunPanel.tsx, RunHistoryPanel.tsx, GateEvidencePanel.tsx
Glitch capture web UI components/proof/CaptureGlitchModal.tsx
Glitch capture form and REQ detail view app/proof/[req_id]/
PR status tracking + CI check display components/review/PRStatusPanel.tsx (renders data.ci_checks)

Also 0.9.00.9.1 to match pyproject.toml, and the DATABASE_PATH default from "in-memory SQLite" to ./.codeframe/state.db, which is what get_db_for_cli actually does.

CHANGELOG listed 1 of 212 commits since v0.9.1 (AC3)

SECURITY.md supports only the latest release, so that omission mattered most for the security work. The new Unreleased section leads with it and flags the ones that change defaults and need configuration on an existing deploy:

Phases 5.1–5.5, the PROOF9 merge gate, worktree isolation and the Playwright rewrite are summarized alongside, with the Changed section covering #946 and #948.

TESTING.md (AC4)

~400 lines of Sprint-1 checklist that imported codeframe.agents.providers.anthropic_provider and told you to start the server with a long-renamed command. Replaced with the current suite: the one gate command, the directory layout, which markers change what runs and why -m replaces rather than combines, the enforced coverage floor (and that it bites on subset runs), and how to run the lifecycle and Playwright suites.

The link/import check (AC5)

tests/test_root_docs_950.py, in the default gate — 43 tests:

  • every relative link in a root doc resolves
  • every codeframe.* module named in a fenced ```python block is importable
  • the README version equals pyproject.toml's
  • the coverage floor TESTING.md quotes equals .coveragerc's
  • every test directory and every marker TESTING.md lists actually exists
  • the roadmap checks pair each claim with the component that proves it, so a box cannot be flipped back to pending without deleting the file
  • CLAUDE.md's doc table is checked separately, since it uses backticked paths the link regex cannot see

It carries its own guards: a non-empty-links assertion per doc (all of zero links resolve), a checkbox-syntax check (a typo'd - [X] renders as plain text, which is how stale entries survive review), and test_the_check_would_catch_a_deleted_module, which asserts the import check still rejects the exact module the old TESTING.md named.

19 of the 43 fail against the pre-fix tree.

Known limitations

  • The link check only sees markdown links. Backticked paths are checked in CLAUDE.md's doc table and TESTING.md's layout/marker tables, but not exhaustively everywhere.
  • SECURITY.md and CHANGELOG.md are skipped by the non-empty-links guard: they legitimately link almost entirely externally. Broken relative links in them are still caught.
  • Only root docs are covered. docs/** is untouched here.
  • The Unreleased section summarizes 212 commits by theme rather than enumerating them; the dependency bumps in particular are left to the commit log.

…950)

The files a first-time user or contributor opens described something that does
not exist.

CONTRIBUTING.md taught the dead v1 auth model — get_current_user,
db.user_has_project_access(), /api/projects/{id} — none of which are in the
codebase, and linked four paths that are not either (docs/architecture/,
docs/authentication.md, codeframe/providers/base.py,
codeframe/tasks/test_runner.py).

Rewritten around what actually enforces auth: router-level dependencies=_AUTH in
server.py, require_auth accepting a JWT or an X-API-Key, CODEFRAME_AUTH_REQUIRED
read at request time, real scopes from the user row, get_v2_workspace enforcing
the WORKSPACE_ROOT allowlist, and single-use stream tickets instead of a JWT in
a URL. The headline for a contributor is that a new v2 router is protected by
HOW IT IS MOUNTED and by nothing else. The provider/adapter sections now point
at adapters/llm/base.py and core/adapters/agent_adapter.py, which exist.

README contradicted itself: PROVE and SHIP listed web gates, glitch capture and
PR status tracking as pending while the Web UI section marked the same things
shipped. Verified each against the components — GateRunPanel, CaptureGlitchModal,
/proof/[req_id], PRStatusPanel with its ci_checks rendering — and flipped the
four stale boxes. Also 0.9.0 -> 0.9.1 to match pyproject, and the DATABASE_PATH
default from "in-memory SQLite" to ./.codeframe/state.db, which is what the code
does.

CHANGELOG's Unreleased listed 1 of 212 commits since v0.9.1. Since SECURITY.md
supports only the latest release, that omission mattered most for the security
work: WORKSPACE_ROOT failing closed (#896), the bootstrap registration gate
(#897), real scopes and tenancy (#898), the untrusted-repo boundaries
(#903/#904/#905/#895), subprocess containment (#906/#907/#899/#721/#996), stream
tickets (#745), dispatch-time webhook SSRF vetting (#746), credential handling
(#772/#790/#718) — several of which change defaults and need configuration on an
existing deploy, so they are called out as such. Phases 5.1–5.5 and the merge
gate are summarized alongside.

TESTING.md was ~400 lines of Sprint-1 checklist importing
codeframe.agents.providers.anthropic_provider and starting the server with a
long-renamed command. Replaced with the current suite: the one gate command, the
directory layout, which markers change what runs, the enforced coverage floor,
and how to run the lifecycle and Playwright suites.

AC5 — the link/import check — is tests/test_root_docs_950.py, in the default
gate. Every relative link in a root doc must resolve; every codeframe module
named in a fenced python block must be importable; the README version must equal
pyproject's; the coverage floor TESTING.md quotes must equal .coveragerc's; every
test directory and marker TESTING.md lists must exist. The roadmap checks pair
each claim with the component that proves it, so a box cannot be flipped back
without deleting the file. It carries its own guards too: a non-empty-links
assertion (all of zero links resolve) and a test that the import check still
rejects the deleted module it was written for.

19 of the 43 fail against the pre-fix tree.
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Claude finished @frankbria's task in 6m 27s —— View job


🔍 Bug-hunting review complete

Scoped to concrete defects only (logic errors, null/unhandled-error paths, security, data loss, contract breaks, resource leaks). The only code in the PR is tests/test_root_docs_950.py; the rest is markdown.

  • Gather PR diff and context
  • Check existing review comments (none prior)
  • Inspect each suspicious hunk against surrounding code
  • Post inline findings → none warranted
  • Post summary comment

Result: no defects found. Verified against the checked-out tree — every file/path/version/marker the new tests assert on resolves, the documented auth pattern matches server.py:864/886, and find_spec behaves as the meta-guard assumes. Summary posted here.

A separate general-purpose review covers style, architecture, naming, and coverage.

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

GLM bug-hunting review: no defects found.

Scoped to concrete defects only (logic errors, null/unhandled-error paths, security, data loss, contract breaks, resource leaks). The only code in the PR is tests/test_root_docs_950.py; the rest is markdown.

Verified against the checked-out tree:

  • Every file/path the tests assert on exists: the 7 ROOT_DOCS, every relative-link target (incl. codeframe_github_header_1600x500.png, PRIVACY.md, TRADEMARKS.md, the two codeframe/.../*.py adapter paths, tests/e2e/playwright.config.ts, tests/ui/test_v2_auth_enforcement.py, tests/conftest.py, .github/workflows/test.yml, legacydocs/SPRINTS.md), all 9 tests/*/" layout dirs, the CLAUDE.md doc-table docs/*.md, and the three web-ui components / the proof/[req_id]` route.
  • Version (0.9.1), coverage floor (fail_under = 80), and markers in TESTING.md all match pyproject.toml / .coveragerc / pytest.ini.
  • tomllib import is safe (requires-python>=3.11).
  • find_spec('codeframe.agents.providers.anthropic_provider') raises ModuleNotFoundError (parent pkg absent) → the meta-guard behaves as written.
  • CONTRIBUTING's _AUTH = [Depends(require_method_scope)] example matches codeframe/ui/server.py:864/886 exactly, and the dead v1 symbols (user_has_project_access, get_current_user, /api/projects/{id}, db.get_project) are genuinely gone.
  • No markdown link-title form ([t](p "x")) in any root doc that the LINK regex would mis-capture; all README checkboxes are valid - [x]/- [ ] forms.

A separate general-purpose review covers style, architecture, naming, and coverage.

@frankbria
frankbria enabled auto-merge (squash) August 3, 2026 04:28
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Claude finished @frankbria's task in 3m 32s —— View job


🔍 GLM bug-hunting review (re-run on synchronize)

Scoped to concrete defects only (logic errors, null/unhandled-error paths, security, data loss, contract breaks, resource leaks). Style, architecture, naming, and coverage are covered by the general-purpose review.

  • Gather PR diff and context (gh pr view / gh pr diff)
  • Check existing review comments — don't repeat prior findings
  • Inspect suspicious hunks against the checked-out tree
  • Post inline findings (if any) → none warranted
  • Post summary

✅ GLM review: no defects found.

What the synchronize actually was: git log origin/main..HEAD shows the branch's only new commit since the last review is ff72da6 Merge branch 'main' into fix/950-root-docs. git diff origin/main...HEAD is unchanged — the same 5 files (4 markdown + tests/test_root_docs_950.py). The only content brought in by the merge is main's tests/ui/test_v2_untested_routers_947.py, which is not part of this PR. So the doc/test content under review is identical to commit 2519064 that the prior pass cleared.

I re-derived the verdict independently against the checked-out tree rather than trusting the prior pass:

Test's load-bearing assumption Verified against tree
find_spec("codeframe.agents.providers.anthropic_provider") raises (meta-guard) codeframe/agents/ is a real package (__init__.py + dependency_resolver.py), but codeframe/agents/providers/ is absent → importing the parent codeframe.agents.providers raises ModuleNotFoundError, so find_spec raises and pytest.raises catches it. (Note: the prior pass said "parent pkg absent"; codeframe.agents actually exists — only …agents.providers is absent. Same outcome, slightly different why.)
Auth symbols documented in CONTRIBUTING are real require_auth, require_method_scope, require_scope all defined in codeframe/auth/dependencies.py:474/549/636
CONTRIBUTING's _AUTH = [Depends(require_method_scope)] example matches reality Matches codeframe/ui/server.py:864 exactly
Roadmap components exist GateRunPanel.tsx, CaptureGlitchModal.tsx, PRStatusPanel.tsx all present; web-ui/src/app/proof/[req_id]/page.tsx present
Markers TESTING.md lists are registered e2e_llm, lifecycle, slow, v2 all in pytest.ini (the regex captures only the first backticked token per row, so integration/edge_case on the shared row are unchecked — under-checking, safe direction, not a defect)
All 9 tests/* dirs TESTING.md names exist core, ui, cli, adapters, unit, integration, agents, e2e, lifecycle — all present
.coveragerc floor the test parses [report] fail_under = 80 present and parseable
README checkboxes well-formed All roadmap items are - [x] … / - [ ] … with trailing content; no bare checkboxes that the strict ^\s*- \[[ x]\] form would false-flag

Two latent fragilities I considered and discarded as out-of-scope (both fail loudly — safe direction — and neither trips on current content): the LINK regex would treat a titled markdown link [t](p) as a broken target p "x", and the checkbox regex flags a bare - [ ] (no trailing space/content) as malformed. Neither form appears in any root doc today.

@frankbria
frankbria merged commit 7dc6be6 into main Aug 3, 2026
12 of 13 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.

[P1.32] Bring the root documentation in line with the shipped product

1 participant