📖 [Docs]: A working checkout of a docs repository is no longer treated as context - #153
Open
Marius Storhaug (MariusStorhaug) wants to merge 3 commits into
Open
📖 [Docs]: A working checkout of a docs repository is no longer treated as context#153Marius Storhaug (MariusStorhaug) wants to merge 3 commits into
Marius Storhaug (MariusStorhaug) wants to merge 3 commits into
Conversation
The freshness gate only protects the clones the bootstrap created. A working checkout of a documentation repository sits outside it, has nothing that fetches it, and stays readable when it falls behind, so following it fails silently. State the distinction by role next to the gate, record why, and name the ahead/behind check that settles it. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The requirement said context must be fresh without saying which artifact carries it. Add a requirement that canonical context is read from gate-validated clones and that a working checkout is not one, plus the matching success criterion. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
4 tasks
Copilot started reviewing on behalf of
Marius Storhaug (MariusStorhaug)
August 2, 2026 19:01
View session
There was a problem hiding this comment.
Pull request overview
This PR clarifies the agentic-development guidance that canonical context must be read from gate-validated clones, and that a working checkout of a docs/memory repo (cloned to edit) must not be treated as an authoritative context source, even if it exists locally and is readable.
Changes:
- Updates the Ways of Working → Agentic Development narrative to explicitly distinguish gate-validated clones vs. working checkouts, including rationale and a verification command.
- Extends the agentic-development capability spec with an RFC-2119 requirement stating that working checkouts MUST NOT be used as context sources, and adds a matching success criterion.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/docs/Ways-of-Working/Agentic-Development.md | Adds a new subsection explaining why working checkouts are not authoritative context and how to verify divergence. |
| src/docs/Capabilities/agentic-development/spec.md | Adds a normative requirement + success criterion to scope the existing freshness gate to gate-validated clones (excluding working checkouts). |
…nd both counts must be zero Copilot review noted the snippet was two commands described as one, hard-coded origin/main while the surrounding text said the default branch may differ, and treated only the behind count as disqualifying. A checkout that is ahead or diverged fails the same bar the gate applies. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot started reviewing on behalf of
Marius Storhaug (MariusStorhaug)
August 2, 2026 19:05
View session
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Suppressed comments (1)
src/docs/Capabilities/agentic-development/spec.md:68
- The spec says a reader can verify a checkout with
git rev-list ...“after fetching”, but it doesn’t show an explicit fetch command. If someone runsrev-listwithout fetching first, the remote-tracking ref may be stale and the check can give a false sense of freshness. Consider spelling out the fetch step inline to make the verification procedure self-contained.
- **Working checkouts are not context sources.** Canonical context MUST be read from the context repository clones that passed the freshness gate. A working checkout of a `docs` or `memory` repository — one cloned in order to change it rather than to be governed by it — MUST NOT be used as a context source, whatever path it occupies, because it sits outside the gate: nothing fetches it, and a superseded page in it is readable rather than missing, so the failure is silent. A reader MAY establish whether any checkout is current with `git rev-list --left-right --count HEAD...origin/<default-branch>` after fetching, which reports commits ahead and behind without changing the working tree.
Marius Storhaug (MariusStorhaug)
marked this pull request as ready for review
August 2, 2026 19:07
Marius Storhaug (MariusStorhaug)
enabled auto-merge (squash)
August 2, 2026 19:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The agentic development guidance now says which copy of the documentation an agent is allowed to read as guidance. Canonical context comes from the clones the workspace bootstrap fetched and validated; a working checkout of a
docsormemoryrepository — one cloned in order to change it — is not a context source, even when it is sitting on disk and opens perfectly well.Changed: which checkout counts as canonical context
Agentic Development gains a section next to the freshness gate stating the distinction, and the agentic development spec states it as a requirement so the existing fresh-context MUST now names the artifact it governs. The rule is written in terms of role rather than path: what makes a clone canonical is that the gate proved it current, not where it lives, so it holds for any initiative's documentation repository and for whatever location a contributor cloned it into.
The reason is recorded with it, because the reason is what makes the rule stick. A working checkout has no freshness gate — nothing fetches it, nothing fails when it falls behind, and a superseded page in it is still present and still readable. The failure is therefore silent and self-confirming: a prompt written from a checkout 26 commits behind cited a documentation page that had not existed upstream for 26 commits, and the agent that followed it could not tell, because the page it was sent to opened.
New: a check that settles whether a checkout can be trusted
Rather than trusting a checkout, verify it — a fetch and a count, neither of which changes anything in the working tree:
The two numbers are the commits the checkout is ahead of, and behind, the remote head, and both must be zero — the same bar the freshness gate applies, where being ahead or diverged fails just as being behind does. Anything else means the checkout is not fit to be read as guidance: read the validated clone instead, or bring the checkout up to the remote head first. Nothing about editing documentation through a working checkout changes — the checkout is where a change is written, not where the rules are read.
Technical details
src/docs/Ways-of-Working/Agentic-Development.md— new### A working checkout is not a context sourcesubsection at the end of The workspace bootstrap, carrying the role-not-path distinction, the reason, and the verification command. The worktrees paragraph moved above the new heading so it stays part of the parent section rather than being absorbed into the subsection. One clause added to the Architecture refresh-gate paragraph linking to the new anchor, so a reader arriving at the gate learns what it governs.src/docs/Capabilities/agentic-development/spec.md— new requirement Working checkouts are not context sources directly after Fresh context before use, keeping RFC-2119 form (MUSTbe read from gate-validated clones,MUST NOTuse a working checkout,MAYverify with the ahead/behind command), plus a matching success criterion. The existingMUSTis untouched; this states its scope.git rev-list --left-right --count HEAD...origin/mainreturned1 29for a checkout 1 ahead and 29 behind, and0 0for a synchronized one. It reports the two counts and leaves the working tree untouched, as Say that a working checkout of a docs repository is not a context source #132 claims. Both surfaces write the ref asorigin/<default-branch>rather than hard-codingmain, and require both counts to be zero, so the documented check matches the gate rather than a subset of it.origin/mainagainst surrounding text that said the default branch may differ, and treating only the behind count as disqualifying. All three are fixed in26020fd; round two was clean.<type>/<issue>-<slug>: the app's branch-rename tool strips/and refuses a second call, sodocs/132-context-sourcewas unreachable and the flatdocs-132-context-sourcewas used.src/docs/Ways-of-Working/**src/docs/Capabilities/agentic-development/**.github/scripts/Invoke-PesterSuite.ps1and dependency updates, with no overlap. No additional issue is fully satisfied by this diff.Test-DocumentationLink.ps1(114 files, all links resolve),Update-DocumentationIndex.ps1 -Check,markdownlint-cli2with.github/linters/.markdown-lint.yml,codespell, textlint with.github/linters/.textlintrc(rules confirmed loaded against a probe file), andInvoke-PesterSuite.ps1(54 tests) all green, matched by green CI.Related issues