Skip to content

docs: make a clone of this repo self-contained - #32

Merged
velzepooz merged 6 commits into
mainfrom
docs/self-containment
Sep 7, 2026
Merged

velzepooz merged 6 commits into
mainfrom
docs/self-containment

Conversation

@velzepooz

Copy link
Copy Markdown
Collaborator

Development is moving to an external agent that receives one repository at a time as a fresh clone. Until now a clone of this repo carried README.md, CONTRIBUTING.md, CHANGELOG.md and code — no coding contract, no architecture, no statement of how this repo relates to the hosted scanner or the Action.

This publishes a general-terms doc set and nothing more.

What a clone now carries

File What it is
AGENTS.md The coding contract: stack, wiring points, scan scope, adding a rule, testdata conventions, release. CLAUDE.md is a symlink to it.
docs/README.md Doc map.
docs/architecture.md Pipeline stages, package tree and dependency direction, the Rule interface, the path-gating contract, the skill-root predicate, axis aggregation, schema enforcement.
docs/glossary.md Domain terms.
docs/product-context.md What the product is and who uses it.
docs/cross-repo.md How the three repos depend on each other, and the three places that pin the engine version.

docs/development-guide.md was already published and is unchanged in purpose; it was corrected.

What stays out

Design specs, implementation plans, decision records, verification logs and component state remain local-only, as before. .gitignore moves from a blanket exclusion to an explicit allow-list, so adding a document to the published set is now a deliberate act.

AGENTS.md gains a Settled behaviour section: a short list of things not to change on inference — the axis set, the exit-code contract, the JSON wire shape, the registry checksum's role, scope and path gates, demotion thresholds, and the empty-scan result shape. Each is settled for a reason that is not visible in this repository, so the rule is to ask first.

Corrections found while writing it

Matching the documents against the code turned up statements that were wrong:

  • the published scan scope omitted AGENTS.md, GEMINI.md, .cursorrules, .windsurfrules, .github/copilot-instructions.md, .cursor/rules/*.mdc, .cursor/mcp.json and .vscode/mcp.json
  • the pipeline order was stated as rules → triage → allowlist → scoring; the code scores first and triages last
  • pkg/scorer was drawn as a dependency of cmd/, which does not import it
  • pkg/permission was described as parsing declared permissions; it infers them from findings and file content
  • README.md said --scan-all walks every scannable file; the hardcoded skip-dirs survive it
  • three comments in grade_reachability_test.go cited a document for a claim it no longer makes; they now state the claim inline
  • docs/development-guide.md described pkg/scorer as a legacy flat-score package and pkg/permission as manifest extraction; neither was true

No behaviour changes. The only non-documentation edits are comments.

Verification

go test ./... — 1085 tests, 12 packages, green.

A gate in the workspace clones this repo and asserts that the published set is present, that the withheld set is absent, that no withheld pointer or internal term survives in any tracked file outside a written exemption list, and that every relative link resolves inside the clone. It was defeated three times during review and rebuilt each time — the checks that matter are the ones that have been shown to fail.

https://claude.ai/code/session_01XAY7LzfeuEZBgSLuzpWUAH

A fresh clone of this repo carried no coding contract at all. This one is
written for publication: settled behaviour is stated as rules, and the
reasoning behind it stays out of the repo.

Claude-Session: https://claude.ai/code/session_01XAY7LzfeuEZBgSLuzpWUAH
The Scope section named only CLAUDE.md and two MCP paths, so the published
contract disagreed with the published README about what the scanner walks by
default. It now matches pkg/rules/fileclass.go: every harness instruction
file and all four MCP config paths. Also fixes two stale fixture paths and
states that an empty scan does not grade.

Claude-Session: https://claude.ai/code/session_01XAY7LzfeuEZBgSLuzpWUAH
A fresh clone now states what the project is, how this repo is built,
and how it relates to the hosted scanner and the Action. Design history
and component state stay out of the repository.

Claude-Session: https://claude.ai/code/session_01XAY7LzfeuEZBgSLuzpWUAH
The pipeline order, the dependency tree, the registry and permission
descriptions, and the claim that the Action imports pkg/ were each wrong
against the source. The docs map also asserted something about this
repository's history that is not true.

Claude-Session: https://claude.ai/code/session_01XAY7LzfeuEZBgSLuzpWUAH
This file is published. It carried two pointers to a decision record that does
not exist in a clone, a fixture-subdir list that had gone stale, a package note
contradicting `docs/architecture.md`, and a paragraph of internal measurement
that told a reader nothing they could act on.

- `pkg/triage` is now described the way `docs/architecture.md` describes it:
  a seam that is a no-op unless a Verifier is injected.
- Fixture subdirs are no longer enumerated; `ls testdata/malicious/` is the
  live answer and cannot go stale.
- Skill roots are described by what they are (a directory holding `SKILL.md`
  or `skill.yaml`) instead of by a pointer to an unpublished record.
- The adversarial-fixtures rationale keeps its structural argument and loses
  the internal measurement; the table rows describe what each table asserts.
- `make fmt` is documented as `gofmt -s -w .`, which is what the Makefile runs.

Every command and `-run` pattern left in the file was executed against this
tree: all pass, and `-run TestBench` was confirmed to select a test (a bogus
pattern reports "no tests to run").

Claude-Session: https://claude.ai/code/session_01XAY7LzfeuEZBgSLuzpWUAH
- grade_reachability_test.go: the comments explained the grade-scale
  claim by citing documents instead of stating it, so a reader had to
  leave the file to learn what the test asserts. State the claim, its
  premise, and the reason each map exists inline.
- development-guide.md: pkg/permission infers capabilities from findings
  and discovered file contents; it parses no manifest. pkg/scorer carries
  per-finding confidence, diagnosis and config overrides; there is no
  flat score in it.
- README.md: --scan-all stops honoring .gitignore. The hardcoded
  skip-dirs survive it, and a SKILL.md inside one still creates no scope
  root.
- architecture.md: Extract works from three inputs, not two — the third
  is a baseline filesystem permission added whenever any file was
  discovered.

Claude-Session: https://claude.ai/code/session_01XAY7LzfeuEZBgSLuzpWUAH
@velzepooz
velzepooz merged commit 22243e8 into main Sep 7, 2026
4 checks passed
@velzepooz
velzepooz deleted the docs/self-containment branch September 7, 2026 10:38
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