Skip to content

fix(docs): access.md carries unresolved conflict markers from #787 - #817

Merged
sydevs-bot merged 5 commits into
mainfrom
claude/fix-810-access-conflict-markers
Sep 18, 2026
Merged

sydevs-bot merged 5 commits into
mainfrom
claude/fix-810-access-conflict-markers

Conversation

@sydevs-bot

@sydevs-bot sydevs-bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Resolves the raw conflict block in docs/rules/access.md — the only one in the tracked tree. It loaded both contradictory halves into every agent session reading src/plugins/access/.
  • Neither half was wholly current, so the resolution is a mix: origin/main's client-grant paragraph, HEAD's ⚠ paragraph.
  • Adds 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

  • Lean gate: ✓ lint, typecheck, typecheck:tests, test:unit (155 files, 2135 tests, 56s)
  • Targeted specs: the new guard, 2 passed. No integration spec applies — nothing under src/ changed.
  • Build: N/A (Railway builds the preview)

Manual verification

  1. Read the surviving two paragraphs in docs/rules/access.md. The client grant must name both wemeditate-web and sahaj-atlas as create-only on user-submissions and cite feat(api)!: unified intake, phase 1 — the user-submissions schema #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:

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:

  • Put the check behind pnpm lint instead of the unit lane (compose package.json's lint script with a scripts/ 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.
  • Broaden the pattern to ||||||| and to markers with no trailing space. Declined: real git merge, rebase, stash apply and merge-file output was checked across merge, diff3 and zdiff3 styles, 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; main meanwhile 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:

  • -I skipped whatever git calls binary, which 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 — the guard green with the block committed. Without -I the same tree reports Binary 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.
  • The fixture proved the pattern but not the scan. --no-index bypasses index enumeration, the pathspec and .gitattributes — every structural way the tracked scan can return 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, exercising the same path the tree test takes, which also let 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.

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 uses actions/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:45 still 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

`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]>
@railway-app

railway-app Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

🚅 Deployed to the SahajCloud-pr-817 environment in sahajcloud

Service Status Web Updated
SahajCloud ✅ Success (View Logs) Web Sep 18, 2026 at 2:47 am UTC
1 service not affected by this PR
  • mailpit

@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-817 September 18, 2026 02:25 Destroyed
@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Sep 18, 2026
@sydevs-bot

sydevs-bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 no session running

recent dispatches
  • 02:41Z address-review · attempt 1 · session · done
  • 02:41Z address-review · attempt 1 · session
  • 02:35Z adversarial-review · attempt 1 · session · done
  • 02:35Z adversarial-review · attempt 1 · session

Written by the sydevs dispatcher. Sessions never edit this comment.

@sydevs-bot sydevs-bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧐 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:45 still 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.md changes" and "nothing under .claude/". Both hold.
  • The resolution against access/config/roles.ts:77-124 and lib/utilities/previewSecret.ts.
  • The pattern against the real block: git grep -E over 43d0b38 returns those three lines in access.md and 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

Comment thread tests/unit/conflict-markers.spec.ts Resolved
@sydevs-bot sydevs-bot added bot:working Lock: a cloud session is running on this item. Removed when it ends. and removed bot:working Lock: a cloud session is running on this item. Removed when it ends. labels Sep 18, 2026
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]>
@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-817 September 18, 2026 02:45 Destroyed
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

One finding adopted, one declined. Pushed 268884c.

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

@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Sep 18, 2026
@sydevs-bot
sydevs-bot marked this pull request as ready for review September 18, 2026 02:56
@sydevs-bot
sydevs-bot requested a review from Ardnived September 18, 2026 02:56
@sydevs-bot
sydevs-bot added this pull request to the merge queue Sep 18, 2026
Merged via the queue into main with commit 9669347 Sep 18, 2026
23 checks passed
@sydevs-bot
sydevs-bot deleted the claude/fix-810-access-conflict-markers branch September 18, 2026 16:41
@sydevs-bot sydevs-bot moved this from Revising to Done in SYDevelopers Technical Roadmap Sep 18, 2026

This branch was successfully deployed

No deployments
sahajcloud / SahajCloud-pr-817 — 268884c4 Deployed Sep 18, 2026 by railway-app[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

fix(docs): access.md carries unresolved conflict markers from #787

3 participants