Repository navigation
fix(docs): access.md carries unresolved conflict markers from #787 - #817
Conversation
`docs/rules/access.md` carried a raw, unresolved conflict block from #787. Markdown is the one place a marker is silent: the same lines in a `.ts` file are a syntax error both `pnpm lint` and `pnpm typecheck` reject, and in `.json`, `.mts` or `.yml` they break a parser. Here they rendered as ordinary text, and no lint covers `docs/`, so the block survived four merges. #801 and #803 each edited prose inside it without seeing it. The file is a `docs/rules/` rule, so it loads into every agent session that reads `src/plugins/access/` — both halves at once, contradicting each other. Neither half was wholly current, so the resolution is a mix. The client-grant paragraph takes the `origin/main` text: both `wemeditate-web` and `sahaj-atlas` may create `user-submissions`, create only. `config/roles.ts:95,122` grants exactly that and nothing else. The `HEAD` text named `wemeditate-web` alone and cited form submissions, a collection #801 deleted. The warning paragraph takes the `HEAD` text, which differs from its twin only in the final clause. "with no live-preview credential at all" is correct; "with no preview secret" names the shared secret #788 deleted. A legitimate draft read now carries a minted Ed25519 token, and `previewSecret.ts` says so in the file: the header name outlived the value it used to carry. Refs #810 Co-authored-by: Claude Opus 5 <[email protected]>
Nothing in the repo grepped for conflict markers, which is why the block in `docs/rules/access.md` survived four merges. A unit spec closes that, and runs in both places that matter: `pnpm test:unit` is the lean gate's fast lane, and `pnpm test` runs it in CI. It is a unit spec rather than a line in `.claude/skills/pr-prep/check.sh` deliberately. `.claude/` is a Claude Code Protected Path, so an unattended run cannot write there — the write is prompted rather than refused, and the session stalls until its lease expires. The scan shells to `git grep`, for scope and for cost. Tracked files are what can land on `main`, and git scans them in ~40ms where reading 76MB of tracked bytes into JS would cost more than the rest of the lane. Two traps are handled in the spec. The patterns are built by concatenation, so the file cannot match itself. And a second test greps a scratch block through the same pattern and the same command, because a pattern typo, a `git grep` that cannot see the tree, and an exit code read the wrong way all produce the same green as a clean tree does. Proven by reintroducing a marker in a tracked file and watching the lane go red. Refs #810 Co-authored-by: Claude Opus 5 <[email protected]>
The three marker tokens are now named constants the pattern and the fixture both build from, so the second test visibly shares the definition it is there to prove. `grep` closed over the one pattern it was ever called with, its two-valued argv fragment became a `noIndex` flag, and the `maxBuffer` knob went — nothing it guarded was reachable. The temp directory the non-vacuity test writes is now removed in `onTestFinished`. Every lane run had been leaving one behind. Cut the docstring roughly in half. One claim in it was also false: reading the tracked tree into JS measures ~130ms against a 27s lane, not "more than the rest of the unit lane". A checkable number that is wrong by two orders of magnitude costs more than it buys, so the comparison is gone rather than restated. Refs #810 Co-authored-by: Claude Opus 5 <[email protected]>
Both found by an adversarial review pass and reproduced before fixing. `-I` skipped whatever git calls binary, and that includes a plain text file marked `-diff` in `.gitattributes`. A scratch repo with `*.lock -diff` and a real conflict block in `deps.lock` exited 1 with no output, so the guard went green with the block committed. Without `-I` the same tree reports `Binary file deps.lock matches`, which is a non-empty row and fails the assertion. A guard should name a media file loudly rather than miss a real block quietly, and the tree has no binary match today. The fixture also proved only the pattern, not the scan. `--no-index` bypasses index enumeration, the pathspec and `.gitattributes` — every structural way the tracked scan can come back empty — so a sparse checkout, or the `-diff` case above, left both tests green. It is now a real repository with the file really tracked, which exercises the same path the tree test takes and lets the `noIndex` branch go. `grep.column` is pinned off. A contributor who sets it globally got `sample.md:1:1:…` and failed the exact-array assertion on a clean tree. A spawn that never ran reported "exited null". It now says git may not be on PATH. Refs #810 Co-authored-by: Claude Opus 5 <[email protected]>
|
🚅 Deployed to the SahajCloud-pr-817 environment in sahajcloud
1 service not affected by this PR
|
|
🤖 no session running recent dispatchesWritten by the sydevs dispatcher. Sessions never edit this comment. |
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 Adversarial review
The diff is the ticket and nothing else: one doc block resolved, one guard. Both halves of the resolution hold against the code. The guard earns its lines — 39a0529 is a single-parent squash of #787, so the block was on that branch and this lane would have failed it there.
Findings
consider—src/plugins/access/accessConfigs.ts:45still reads "no preview secret required", the wording this PR rejects in the doc. It is what an agent reads on opening the code rather than the rule.consider— the spec's header docstring. See the inline thread.
What was checked
- Every acceptance criterion in #810, including "nothing else in
access.mdchanges" and "nothing under.claude/". Both hold. - The resolution against
access/config/roles.ts:77-124andlib/utilities/previewSecret.ts. - The pattern against the real block:
git grep -Eover43d0b38returns those three lines inaccess.mdand nothing else. - The other four repos: no marker in any tracked tree, so there is no case for porting this guard.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
The header retold #787 in six lines that the ticket, the PR body and the commit already carry. What a reader cannot re-derive is the concatenation rule and the tracked-files scope, so those stay and the story goes. The #787/#810 breadcrumb stays too — docs/rules/code-comments.md keeps those whatever else is cut. Refs #810 Co-authored-by: Claude Opus 5 <[email protected]>
|
One finding adopted, one declined. Pushed
Lean gate green on the new head: lint, typecheck, typecheck:tests, test:unit — 155 files, 2135 tests. The PR body is unchanged. A comment trim falsifies nothing in it. 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
Summary
docs/rules/access.md— the only one in the tracked tree. It loaded both contradictory halves into every agent session readingsrc/plugins/access/.origin/main's client-grant paragraph,HEAD's ⚠ paragraph.tests/unit/conflict-markers.spec.ts, so the next marker fails a test instead of surviving four merges.Preview
https://sahajcloud-sahajcloud-pr-817.up.railway.app — nothing in this diff has a runtime surface. One doc file and one spec; no collection, endpoint or component changes.
Test results
lint,typecheck,typecheck:tests,test:unit(155 files, 2135 tests, 56s)src/changed.Manual verification
docs/rules/access.md. The client grant must name bothwemeditate-webandsahaj-atlasas create-only onuser-submissionsand cite feat(api)!: unified intake, phase 1 — theuser-submissionsschema #723; the ⚠ paragraph must end "with no live-preview credential at all".Notes for reviewer
The resolution is the judgement call worth checking. Each half was verified against the code before choosing, not picked by side:
origin/main's text.src/plugins/access/config/roles.ts:95,122grants both clients'user-submissions': ['create']and nothing else.HEAD's text namedwemeditate-webalone and cited form submissions, a collection feat(api)!: unified intake, phase 3 — cutover, and delete the three old collections #801 deleted.HEAD's text. The two differ only in their last clause. feat(preview)!: every panel points at the real page, and the shared secret is gone #788 deleted the sharedSAHAJCLOUD_PREVIEW_SECRETthat "with no preview secret" names, andsrc/lib/utilities/previewSecret.tssays so in the file — the header name outlived the value. A legitimate draft read now carries a minted Ed25519 token.The guard was proven by failing. A marker was reintroduced into a tracked file three times — once per revision of the spec — and the lane went red each time naming the file and line.
Three findings dismissed, with reasons:
pnpm lintinstead of the unit lane (composepackage.json'slintscript with ascripts/file). Declined:tests/unit/already hosts four repo-wide guards whose subject is the tree rather than a function —client-bundle-safety,lib-boundary,public-env-substitution,migration-down-cascade— so this matches its neighbours, and the alternative needs two files plus a separate spec to keep the non-vacuity test. Worth overriding if you'd rather repo hygiene lived in the hygiene gate.|||||||and to markers with no trailing space. Declined: realgit merge,rebase,stash applyandmerge-fileoutput was checked acrossmerge,diff3andzdiff3styles, and every path emits the trailing space even with an empty label; a diff3 block is caught by its other two lines. Broadening mostly buys false positives.^=======$matches a Markdown setext H1, with no allowlist. Accepted as a known limitation, not fixed. A doc quoting a marker at line start in a fenced block would fail the lane — plausibly a future write-up of this very incident. The failure is loud and names the file, and an allowlist with no members today would be speculative machinery.Detail
Provenance. The block landed in
39a0529(#787), not #801 as first filed. #787 branched off #785 and rewrote the ⚠ paragraph;mainmeanwhile took #754, which rewrote the client-grant paragraph. Each side changed a different paragraph, so the merge kept both whole. #801 and #803 then each edited prose inside the block without noticing it.Two silent-failure levers were found and closed after the first working version, both reproduced before fixing:
-Iskipped whatever git calls binary, which includes a plain text file marked-diffin.gitattributes. A scratch repo with*.lock -diffand a real conflict block indeps.lockexited 1 with no output — the guard green with the block committed. Without-Ithe same tree reportsBinary file deps.lock matches, a non-empty row that fails the assertion. The tree has no binary match today, and a guard should name a media file loudly rather than miss a real block quietly.--no-indexbypasses index enumeration, the pathspec and.gitattributes— every structural way the tracked scan can return empty — so a sparse checkout, or the-diffcase above, left both tests green. It is now a real repository with the file really tracked, exercising the same path the tree test takes, which also let thenoIndexbranch go.grep.columnis pinned off: a contributor who sets it globally gotsample.md:1:1:…and failed the exact-array assertion on a clean tree.Known coupling: this is the only spec in the repo that shells out, so the unit lane becomes a hard failure in a tree with no usable
.git. CI usesactions/checkout, so it holds there. The failure is loud, not silent.Measured cost: the scan is ~35ms over 1226 tracked files; the whole spec is ~245ms against a 27s lane. An earlier draft of the docstring claimed reading the tree in JS "would cost more than the rest of the unit lane" — that measured 130ms, wrong by two orders of magnitude, and the claim was removed rather than restated.
Pre-existing, not touched here:
src/plugins/access/accessConfigs.ts:45still reads "no preview secret required" while the doc paragraph now says "no live-preview credential at all". #787 updated the doc and left the comment. Harmless, and out of this ticket's scope.Open question from the ticket, answered: the guard scans tracked files only. A marker must be committed to land on
main, which makes tracked-only the right scope.Closes #810
🤖 Generated with Claude Code
https://claude.ai/code/session_015EFMPtSSP88dVPPKcW8wbt