Skip to content

Let a repository name its own docs-only paths in its ship policy (GST-1974) - #4185

Merged
capy-ai[bot] merged 5 commits into
mainfrom
repo-docs-only-paths-gst-1974
Nov 9, 2026
Merged

capy-ai[bot] merged 5 commits into
mainfrom
repo-docs-only-paths-gst-1974

Conversation

@garrytan

@garrytan garrytan commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

A repository can now name its own human-docs folders in its base branch's ship policy, so a pull request that only edits prose there skips the test suites the way README.md, docs/ and changelog.d/ already do. This serves gstack's goal of shipping fast without skipping the checks that matter.

What changed

Add a docs_only block to .gstack/ship-policy.json on the base branch:

"docs_only": { "allow": ["wiki/board/**.md"], "tests": ["tests/wiki.test.ts"] }
  • Base-only policy. lib/docs-only.ts reads the block with git from the base tip (CI: the merge commit's first parent; pregate and ci-carry: origin/<base>; land: the tip it merges onto). A pull request that edits the policy is never docs-only.
  • Built-in deny always wins. The deny list moved to lib/ship-policy-docs-only.ts and now also covers prompt files, hidden directories and any evals/ or inventory/ folder. allow takes only narrow Markdown globs under a literal directory.
  • Directory readers. A non-prose file that names an allowed directory ('wiki', './wiki', '../wiki', root + '/wiki', ${root}/wiki) keeps the class off unless one of the declared tests covers it. Those tests run in the docs check, and a declared test missing from the branch keeps the class off.
  • Land. land.docs_only_skip reads the block at the base tip and keeps every merged check when the base gained a reader of a changed doc's folder after the pin branched.
  • Unknown keys inside docs_only and land are warnings, not errors. land.docs_only_skip needs min_gstack_version at its own introducing release (LAND_DOCS_ONLY_SKIP_KEY_VERSION), and gstack-ship-policy validate says so.
bun test test/docs-only-policy.test.ts test/docs-only.test.ts
 132 pass
 0 fail

Why

"gstack-evals keeps posts in wiki/board/ and every typo fix runs every suite, then /ship runs them again." A repository can now mark folders like that as human docs from its base branch, and the checks that read those folders still run.

Blast radius

The classifier is shared by CI's docs-scope gate, pregate's docs lane, ci-carry and land. gstack's own policy turns on neither docs_only nor land.docs_only_skip, and with no block every repo-only branch returns early (directoryReaders and pathRefusal read at lib/docs-only.ts). The free suite passed at this exact tree in run 42559023322.

Approvals

Plan: approved: autoplan-20261109024402 (GStack Minder ruling: inside Garry's R81 freeze exception and his "do it").

Summary

Docs that live outside docs/ used to run every suite on every edit. This PR lets the base branch's ship policy name those folders, keeps gstack's own deny list in charge, and fails closed on anything it cannot read. Review found four ways the first draft could skip a test that would then fail on main. Relative directory paths went unseen, a missing declared test passed silently, a rename into docs/ dropped the folder's tests, and land ignored readers the base gained. All four are fixed here with failing-first tests.

Test Coverage

Coverage: 79% value-weighted (79% including 0 weakly covered paths), 3 gaps. 0 tests added by the audit.
Test value: 0 tests written, 0 rejected by the authoring gate, 0 existing tests extended, 0 paths weakly covered.

  • lib/docs-only.ts (readRepoDocs, pathRefusal, referencesTo, directoryReaders, classifyEntries, classifyDocsOnly): ★★★ test/docs-only-policy.test.ts
  • ship-policy docs_only validation, land.docs_only_skip compat, policyWarnings: ★★★ test/docs-only-policy.test.ts
  • land unknown-key warning: ★★ test/ship-queue-land-direct.test.ts
  • pregate and carry docs lane: ★★★ test/docs-only-policy.test.ts
  • [GAP] bin/gstack-ship-policy WARN stderr line and --json warnings merge
  • [GAP] lib/land-docs-only.ts policy read at the base tip (now partly covered by the new land test added in review)

Review added 4 regression tests in test/docs-only-policy.test.ts (relative directory readers, a missing declared test, a rename into docs/ keeping the folder's tests, land keeping checks for a base-gained reader). Each failed at 96efd50 on its own assertion and passes at 2b66bbc.

Tests ran: test 1649 (files, carried from CI run 42559023322)

Pre-Landing Review

Pass 1 (full panel: batched testing/security/state-machines specialist, Red Team, native adversarial, outside voice) found 10 blocking-floor findings, all one of four defects, fixed in 2b66bbc. Pass 2 on the fix range found only informational notes.

Gate edits: 2 listed, 1 read, 0 findings (test/ship-queue-land-direct.test.ts now expects an unknown land key to be accepted, matching the documented warning rule)

Outside review: completed by a Capy subagent on openai/gpt-6.1-sol (Codex CLI is not installed on this machine, so Codex coverage is unavailable).

Review notes

Below the blocking floor; recorded here and not fixed in this PR.

  • INFORMATIONAL lib/pregate/docs-only-lane.ts:37 docs_only.tests always run under bun test
  • INFORMATIONAL lib/land-docs-only.ts:24 land never runs the change's docs tests on the merged tree
  • INFORMATIONAL lib/docs-only.ts:177 extensionless substring tie matches unrelated words
  • INFORMATIONAL lib/docs-only.ts:115 classifier honours a base docs_only block that validatePolicy refuses for min_gstack_version
  • INFORMATIONAL lib/land-merged-checks.ts:51 unknown land keys are warnings here but errors on older gstack
  • INFORMATIONAL lib/ship-policy-docs-only.ts:71 tests entries with spaces split in CI; --json warnings only on validate
  • INFORMATIONAL lib/docs-only.ts:225 missing-test refusal on a stale branch names the wrong fix (fails safe)
  • INFORMATIONAL lib/land-docs-only.ts:25 land compares base and pin readers by path only; a base edit to an existing reader or declared test still skips
  • INFORMATIONAL docs/pregate.md:1491 docs do not describe base-gained readers or the missing-test refusal (addressed by the documentation audit in d57f493)

Exploratory QA

Smoke: the focused suites above (132 pass) plus the adjacent consumers test/docs-only-carry.test.ts, test/docs-only-workflow.test.ts, test/pregate-always-run.test.ts and test/pregate-guards.test.ts (32 pass). The QA method sections were not loaded in this unattended run, so no separate exploratory charter ran.

Design Review

No frontend files changed — design review skipped.

Eval Results

No prompt-related files changed — evals skipped.

Review bot comments

No review bot comments.

Scope Drift

Scope Check: CLEAN

Plan Completion

Plan completion audit: not run (no plan file is bound to this branch). The approved plan is autoplan-20261109024402.

Verification Results

No plan verification items were bound to this run.

TODOS

No TODO items completed in this PR.

Documentation

Status: updated. Four factual corrections bring the docs in line with the docs-only classifier and land changes.

Scope: this branch against base e077053 (14 files, 3 commits): lib/docs-only.ts and lib/land-docs-only.ts diffs, changelog.d/repo-docs-only-paths-gst-1974.md, and the changed regions of docs/pregate.md and docs/ship-policy.md. Not checked against the docs: lib/ship-policy-docs-only.ts, lib/ship-policy.ts, lib/ship-policy-keys.ts, lib/land-merged-checks.ts, lib/pregate/run-check.ts, bin/gstack-ship-policy and the tests. No staged or unstaged changes. Banned terms: none.

Documentation health

  • docs/pregate.md: Updated. The Land paragraph now says land keeps its checks when the base tip gained a directory reader of a repo-admitted changed doc. "Readers by directory" now lists ./dir, ../dir, root + '/dir' and template-literal paths, and says a docs_only.tests file missing from the classified tree refuses the change.
  • docs/ship-policy.md: Updated. The docs_only row now says a listed test missing from the branch refuses the class.
  • changelog.d/repo-docs-only-paths-gst-1974.md: Current. It already covers the missing test and the new base reader; not edited.

Coverage debt: the docs_only reference (ship-policy.md) and how-to and explanation (pregate.md) are covered, with no tutorial; that is acceptable for a policy key. No diagram drift: the edited sections have no diagrams.

Test plan

  • bun run test (carried from CI run 42559023322 at tree 823df853e5e1): 1649 test files passed
  • bun test test/docs-only-policy.test.ts test/docs-only.test.ts: 132 pass, 0 fail

🤖 Generated with Claude Code

Agent notes

Approvals

Approved: yes (record r-f4caee3fd561). The full approval record stays private: this repository is public or its visibility is unknown.
Plan: approved (record r-cb0ed963b15a)
Plan check: approved (record r-cb0ed963b15a)

REVIEW_LOOP: passes=2 blocking_found=10 deferred=0 noted=9 fixed=10 scope=frozen ledgers_read=3 dispatches=8
Gate edits: 2 listed, 1 read, 0 findings
Refs GST-1974

{
  "schema_version": 1,
  "pr": 4185,
  "head": "d57f4938696b44a5c7ea25556fcba27af460b34d",
  "version": "1.98.0.0",
  "base": "main",
  "gate": {
    "test": {
      "pass": 1649,
      "fail": 0,
      "skip": 0
    }
  },
  "ci_carried": [
    {
      "lane": "test",
      "run": 42559023322,
      "attempt": 1,
      "tree": "823df853e5e1137452d28fac85366addb7508337"
    }
  ],
  "session_kind": "unattended",
  "head_tree": "823df853e5e1137452d28fac85366addb7508337",
  "product_patch_id": "70806a1374e05e1eef4cf7e68c6eb789ecbfb9ba",
  "gstack_version": "1.98.0.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 363,
    "rules": "66e5174161eecc2c",
    "base": "a229e2580642d62c78dcc7af317a68c24acca264",
    "registry": "a229e2580642d62c78dcc7af317a68c24acca264",
    "gate_scan": {
      "tagged": 0,
      "head": "d57f4938696b44a5c7ea25556fcba27af460b34d"
    },
    "reasons": [
      "gate-class",
      "runtime=363"
    ],
    "risk": [],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @823df853e5e1 (8 checks, current for d57f4938696b)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/42559023322/attempts/1",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/42558369045/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=823df853e5e1 tests=36728 skipped=89 runs=42559023322/1 profiles=ci-reuse/free-tests heads=d57f4938696b verified=2026-11-09T04:04:04.423Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "updated",
    "scope": "docs/pregate.md, docs/ship-policy.md and changelog.d/repo-docs-only-paths-gst-1974.md against the docs-only classifier and land changes"
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 10,
    "deferred": 0,
    "noted": 9,
    "fixed": 10,
    "scope": "frozen",
    "rounds": 2,
    "ledgers_read": 3,
    "dispatches": {
      "specialist": 6,
      "red-team": 2
    }
  }
}

Open in Capy

garrytan and others added 2 commits November 9, 2026 02:45
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… (GST-1974)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@trunk-io

trunk-io Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 3 commits November 9, 2026 03:37
…base gained in the docs-only class

Review-Finding: review/specialist-batched#1 reader=security
Review-Finding: review/red-team#1 reader=red-team
Review-Finding: review/red-team#2 reader=red-team
Review-Finding: voices/adversarial-native#1 reader=adversarial-native
Review-Finding: voices/adversarial-native#3 reader=adversarial-native
Review-Finding: voices/adversarial-native#5 reader=adversarial-native
Review-Finding: voices/outside-voice#1 reader=outside-voice
Review-Finding: voices/outside-voice#2 reader=outside-voice
Review-Finding: voices/outside-voice#3 reader=outside-voice
Review-Finding: voices/outside-voice#4 reader=outside-voice
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…eps the full checks

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…l and land's base-reader check

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot merged commit 10fc9b1 into main Nov 9, 2026
76 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