Skip to content

fix(loop): close out the open tickets, and fold in #159's preview data - #186

Merged
Ardnived merged 18 commits into
mainfrom
claude/outstanding-tickets
Oct 13, 2026
Merged

Ardnived merged 18 commits into
mainfrom
claude/outstanding-tickets

Conversation

@Ardnived

@Ardnived Ardnived commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Closes #164
Closes #176
Closes #178
Closes #180
Closes #184
Closes #185

Implements every open claude-workflow ticket that can ship now. It also absorbs #159, which is closed in favour of this PR, and fixes one fix-ci defect found along the way. They come as one PR because the maintainer asked for that. Each behaviour is still its own commit and reverts on its own, except #185, which builds on #184's lines.

Not in this PR: #181 is blocked until WeMeditateWeb#183 and SahajAtlasWeb#281 publish the two Storybook libraries. #74 is a human checklist. #3 and #31 wait on GitHub and Anthropic platform changes and are parked until 2026-11-02.

No ceilings value changes, so this PR does not break the rule against shipping a skill change and a ceiling change together. #159's preview.deployWaitMinutes is a new value, not a ceiling. version goes from 3.2.1 to 3.3.0, a minor bump because fix-ci gains a mode.

Commits, and the failure each prevents

Commit Ticket Failure it prevents
fix(loop): run the lib test suite in the lean gate, and pass it from a worktree #176 The 57 workflow/lib tests ran in no gate. Two of them failed inside .claude/worktrees/*, which is where implement-ticket works. leanGate.command now runs the suite, and both halves of the ticket land together, so main never has the new gate without the test fix. This commit edits .claude/workflow.json, a protected path.
fix(comments): a glob's ** spans any depth, and K5 protects Storybook's descriptions #180 globToRe let ** span at most one path segment, so K5 has never matched a real story file (0 of 120). The comment sweep could therefore delete the JSDoc text that Storybook prints as a component's description.
chore(loop): pin the one Storybook version the libraries install #180 Without one shared version, the two libraries drift apart.
fix(loop): a goal whose children were all withdrawn verifies as if they shipped #184 A verify run went looking for merged PRs on a goal whose children all closed as not planned (SahajCloud#897).
fix(dispatcher): verify fires twice when children close together #185 A sibling child's close re-arms verifyDue underneath the verify run that is already in progress, and the unlock then fires a duplicate.
fix(loop): strip a Blocked by line once it becomes a relationship #178 The body line drifted from the native relationship. A blocker cleared by hand came back on the next body edit, and - ~~Blocked by~~ read as a live blocker.
fix(loop): the skills treat a Blocked by line as write-only #178 The skill text still described the old behaviour.
fix(loop): a recheck names the blockers that cleared #178, added Once the line is stripped, a recheck session has nothing in the body that says what the ticket waited on. The recheck fire now carries flags.cleared (owner/repo#N refs, validated by payload.mjs).
feat(dispatcher): carry a failing deploy's link to the advisory comment and the record #164 phase 1 A red Railway preview reached the loop as a bare context name.
feat(loop): parse a failed preview's deployment id and build its log read #164 phase 2 Nothing could read a preview's build log. The new workflow/lib/railway.mjs is pure and never fetches.
feat(loop): a failed Railway preview gets one fix-ci pass that reads its log #164 phase 3 A deploy failure got either no session or a blind fix-ci pass. Deploy mode runs at most once per head and never touches record.fixCi or a ceiling.
chore(loop): bump the plugin cache key to 3.3.0 — Installed plugins would otherwise keep the old skills.
fix(dispatcher): a stood-down fix-ci is not fired again by its own unlock found here At the unlock, current still holds the ending session and dispatches holds only its fire-time entry, which has no outcome. So a pass that stood down without pushing was fired again on the same head, spending a ciFixIterations pass each time. The old test set current: null, a state the unlock never sees.
fix(loop): a deploy pass confirms its preview link against get_status #164, correction #164 assumed no MCP tool returns a commit status. pull_request_read method:get_status does. Deploy mode now reads only a link that a failing status there also carries, so a forged or stale record cannot aim the token at another deployment.
feat(finalize-pr): a preview link must open on data from #159 SahajCloud#874's preview links opened on an empty database, and the PR named a CSV that does not exist. Ported onto the renamed skills: implement-issue is now implement-ticket, and adversarial-review is now review-pr.
feat(finalize-pr): wait for the preview deploy when step 7 needs it from #159 The run that opens a Railway PR has no preview yet, and no later run seeds it. Step 7b is the one bounded wait: preview.deployWaitMinutes (20), which fits the shortest lease of any run that calls finalize-pr (60).
fix(finalize-pr): step 7b leaves a failed deploy to the dispatcher's deploy pass #159 × #164 #159 sent a failed deploy "to fix-ci through CI". A Railway preview is not CI here; the advisory note and the deploy pass handle it.
fix(loop): a workspace token reads the preview logs, and the pass is always on #164 A Railway project token is made for one existing environment, and every PR preview gets a new one, so only a workspace token (Authorization: Bearer) reaches previews. The pass reads with RAILWAY_TOKEN, which is already set in the routines' environment, and has no off switch. Deploy mode is down to four steps.

Deviations from the tickets (accepted by the maintainer)

The Railway token

RAILWAY_TOKEN is a workspace token, already set in the routines' cloud environment. It reaches every project in the workspace, production included, because a project token cannot reach a PR preview. That environment has no secret store. The skill never prints the token, and its hard rules forbid any write to Railway. Before merging, it is worth running the one-line check in docs/routine-setup.md §4 against SahajCloud#879's failed preview (deployment 963aac12-f6c4-4b6e-bc9a-9feac615c336).

Also still open after merge

previewUrl.seed is still unset in every repo, so #159's step 7 takes its cannot seed branch and says what is missing. SahajCloud's key needs its own attended PR, because .claude/workflow.json is a protected path.

Gates

Run on the final tree:

  • claude plugin validate ./workflow --strict: passed.
  • node --test workflow/lib/*.test.mjs: 89/89 from a worktree and from a checkout layout (57 on main).
  • node --test dispatcher/test/*.test.mjs: 241/241 (214 on main).
  • jq -r .leanGate.command .claude/workflow.json | sh: passed from a worktree.
  • node workflow/lib/rule-delta.mjs --base origin/main workflow/skills: directives: 87 → 90, none removed. Added: Never seed real people's contact details., Never name a fixture you have not checked., Never redeploy, restart, or change anything on Railway.
  • node workflow/lib/comment-rule-sync.mjs ..: all four copies match and load.
  • comment-fingerprint.mjs --selftest: passed against WeMeditateWeb and SahajAtlasWeb.

Each new test was seen to fail against the code it covers.

Not verified: the BOT_DISPATCH=dry supervised dispatches, a Railway read with the real token (it lives only in the cloud environment), and step 7b against a live preview.

Security review

These files match securityReview.triggerPattern: loop-config.json and nine skill .md files (finalize-pr ×2, fix-ci, format-ticket, implement-ticket, review-pr, revise-roadmap, write-ticket, audit-code/comment-sweep.md).

  • No allowed-tools grant changed.
  • The token's name lives only in loop-config.json, and the skill never prints its value. It is a workspace token, so it can reach production; fix-ci's hard rules forbid redeploying, restarting or changing anything on Railway.
  • railway.mjs accepts only https links on railway.com or railway.app, with every id a UUID, and the session cross-checks each link with get_status.
  • The advisory comment links only https URLs, with parentheses escaped.
  • flags.cleared accepts only owner/repo#N.
  • feat(finalize-pr): a preview link must open on data #159's seed rule forbids real people's contact details on a preview, which anyone with the URL can reach.

🤖 Generated with Claude Code

Ardnived and others added 11 commits October 12, 2026 10:14
…a worktree

`workflow/lib/*.test.mjs` held 57 tests that no gate, skill or doc named, so
the scripts that own the loop's mechanical rules (budget.mjs, payload.mjs,
base-ref.mjs) had regression tests that never ran. Two of them also failed
inside `.claude/worktrees/<slug>` — where implement-ticket works by default —
so the one command a run would reach for to check its own change reported
failures that were not its own.

The two failures asserted the environment, not the function:
`defaultAttachedDir()` resolves three levels up from its module, which is
the checkouts directory only from the checkout. Its one caller is its own
CLI, run by start-run step 2 from the checkout before any worktree exists,
so the function is checkout-only and stays as it is. The path-math test
keeps its assertion and drops the existsSync; the attached-check test now
builds a fixture root (mkdtemp plus an empty claude-workflow directory, as
base-ref.test.mjs does) and also asserts that a missing checkout is
refused. Seen red with the existsSync check disabled.

Then the gate (decision 1A): `leanGate.command` gains
`node --test workflow/lib/*.test.mjs` after the validator, and
`leanGate.contents` stops saying there is no test suite. The ticket orders
the gate edit after the test fix because a gate merged alone would turn
every worktree run red; both land in this one PR, so main never sees the
gate without the fix. `.claude/workflow.json` is a protected path, edited
attended.

57/57 pass from the checkout and from a worktree.

Closes #176

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…'s descriptions

globToRe rewrote `**/` to `(.*/)?` and then rewrote every `*`, including
the two inside the group it had just written, giving `(.[^/]*/)?`: one
path segment at most. Every story file in both repos sits two or three
segments deep, so K5 (`**/*.stories.tsx`) has matched 0 of their 120
story files since it was written. globToRe now converts in one pass, so
`**` spans any depth. The separate denyPaths converter already handled
depth and is left alone; the two converters duplicate each other.

The comment sweep's rule 1 deletes a comment that restates a name, and
that is exactly what a Storybook reference page prints for a component
and for each prop row (`/** Button size @default 'md' */` on `size`).
K5 becomes that guard: renamed off Ladle; widened from stories files to
the component trees (components/, src/components/, src/views/, and
**/*.stories.tsx anywhere: 183 files in WeMeditateWeb and 162 in
SahajAtlasWeb, every story file included, plus SahajCloud's 97
components, which is fail-safe); narrowed from `^` to a docblock; and
`position`, which nothing read, is dropped. comment-sweep.md's "Never
delete" list now names the category.

Fixing globToRe revives K5 for the first time, and that is intended:
the verifier now reports a PROTECTED VIOLATION when a sweep deletes a
docblock in one of those files, where it reported nothing before
(checked on WeMeditateWeb's Button.tsx: K5 13 to 12). The docblock-only
pattern keeps it from firing on every deleted `//` comment there, which
`^` would have done.

The globs stay under the existing `pathGlob` key, which now takes a
string or an array, rather than a new `pathGlobs` key. comment-sweep.mjs
builds the codemod's KEEP list from the rules without `pathGlob`, so
under a second key K5 would have joined it and stopped tier 2 collapsing
any docblock in any file. One key leaves comment-sweep.mjs and its
behaviour unchanged. A test pins this.

comment-protect.test.mjs (21 tests, over paths and fixture text only, so
it needs no typescript) covers each case. Every test was seen to fail
against the pre-change code or a reintroduced defect. The remaining
Ladle mentions in finalize-pr and docs/cleanup.md now name the Storybook
library.

Refs #180

Co-Authored-By: Claude Opus 5.5 <[email protected]>
WeMeditateWeb and SahajAtlasWeb are moving their component libraries
from Ladle to Storybook, and SahajCloud#915 follows. Each installs
Storybook in its own repo, so without one shared value the libraries
drift onto different versions and their component manifests stop being
comparable. loop-config.json now holds that value, storybook.version,
for each library child and SahajCloud#915 to read when they install.

10.6.1 is the version SahajCloud#902 records as settled and build-tested
on Node 22.17.0. The block holds the value only: the rule that reads it
lives in the library children's own skills and setup, and the story
stays in SahajCloud#902. No `projects` key yet; the agent-connector
child adds it beside the version when it ships.

Revertable on its own: nothing reads the key until a library child
lands.

Closes #180

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ey shipped

When a roadmap goal's last child closes, the dispatcher fires revise-roadmap
in verify mode. It read each child's state and never its state_reason, so a
set closed entirely as not planned looked the same as one that shipped. On
sydevs/SahajCloud#897 three children were withdrawn ("this feature restarts
from the roadmap goals") and the verify run went looking for merged PRs that
never existed.

The fire is kept: a withdrawn set leaves the Technical notes block claiming
work is built, and only a session can rewrite it. What was missing is the
fact. Now:

- gather.mjs carries each child's stateReason from the sub-issues response.
- decide.mjs computes the verify flags in one helper, verifyFlags, read by
  both fire sites (child-closed, and the verifyDue path on unlock), so the
  lock can no longer decide whether the fact survives. withdrawn: true only
  when every child closed as not_planned; a mixed set keeps today's verify.
- fire.mjs buildRecord and workflow/lib/payload.mjs both whitelist flags to
  onDemand/delegated/mode, so a bare flag on the plan never reached the
  session or the dry-run record line. Both now carry withdrawn, as true or
  absent, so every other record keeps its exact shape.
- revise-roadmap's Verify section tells a withdrawn run to report the goal
  unstarted, correct the notes block, tick nothing and close nothing.
- docs/why.md gains the withdrawn case beside a-goal-is-verified-not-assumed.

Tests: both fire sites agree for an all-withdrawn and a mixed set; gather
carries stateReason; a dry-run act prints withdrawn in the record and writes
nothing; payload carries withdrawn only as true.

Closes #184

Co-Authored-By: Claude Opus 5.5 <[email protected]>
When a roadmap goal's children close seconds apart, each closure is its own
act leg. One leg reads every child closed and fires verify. A sibling leg
that gathers after the lock is on re-arms verifyDue, because it cannot tell
the verify it would wait for from any other handler holding the lock. The
verify's own unlock then consumes the flag and fires verify again. On
sydevs/SahajCloud#897 the second run started ten minutes later under a fresh
lease, found the work done, and wrote nothing. Closing children together is
the normal shape, so every completed goal paid for a wasted session.

Fixed at the consumer, as the ticket proposes. On unlock, record.current is
still the session that is ending. If it was revise-roadmap in verify mode and
every child closed at or before it fired, the re-armed flag is cleared and
nothing fires. The comparison is by timestamp, so a child reclosed during
the run still gets its check. Guarding the producer alone is not enough:
apply writes the lock label before rec.current, so a leg gathering in that
window re-arms anyway.

gather.mjs carries closedAt from the sub-issues response. The comparison
uses Date.parse, since GitHub's closed_at has no milliseconds and firedAt
does, and plain string order misreads the same second. A child with no
closedAt counts as not yet verified, which fires: a duplicate verify is
idempotent, a missed one is not.

Unlike the ticket's sketch, the skip does not return early. It falls through
to the ordinary unlock, so a verify that left a gap still ends with the goal
awaiting, exactly as an unlock with nothing re-armed would. An early return
would have dropped that label in the race case only. When the unlock path
does fire, it still uses verifyFlags, so #184's withdrawn flag rides on it.

The deadline path is untouched: a verify that times out is re-fired from
rec.current with its own flags, which a new act test now pins.

Closes #185

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The dispatcher turned a `Blocked by:` line into a native relationship and
left the line in the body, a second copy that drifted from the first. Every
later `issues.edited` pass read it again, so a blocker a reviewer had cleared
was re-POSTed, with `blocked` re-applied, on the next unrelated body edit. A
struck line made it worse. `- ~~Blocked by: …~~` read as live, because the
strike test ran before the bullet came off.

Now the pass that makes the relationship deletes the line:

- markers.mjs: `stripBlockedBy` is pure and sits beside `parseBlockedBy`,
  sharing its line test. It drops a line only when every in-org target on it
  is related. Every other byte stays, CRLF included. The blank run a drop
  leaves collapses to one, and an emptied `## Notes` heading stays.
- apply.mjs: the `relationships` case collects the targets that ended related
  (already present in any state, or POSTed without error), re-reads the body
  and PUTs the stripped copy. It never builds from the gathered snapshot:
  `issues.edited` takes no lock, so a session may have rewritten the body
  since `gather`. A dry run logs the lines and writes nothing. A failed strip
  is logged and leaves the line for the next edit.
- gather.mjs: `blockedByAll` carries every relationship, closed blockers too,
  so a line naming a closed blocker is stripped, not re-POSTed.
  `blockedByOpen` is unchanged.
- decide.mjs: only the two body passes, `issues.opened` and `issues.edited`,
  ask for the strip. Both already refuse a non-member's own line. A
  `block on` verb's targets come from a comment, so a member's verb never
  strips a stranger's line.
- The bullet now comes off before the strike test, so a struck list item is
  skipped and `- **Blocked by sydevs/X#9.**` still reads. `parseRecheck`
  keeps its test, with a note that a list item never reaches it.

There is no sender filter. The strip's own edit fires `issues.edited`, and
that echo pass finds no marker and stops. The story is in
docs/why.md#a-converted-blocker-line-is-deleted.

Closes #178

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The dispatcher now deletes a `Blocked by:` line once its relationship
exists, so three skills described behaviour that no longer holds.

- format-ticket: the line is converted, then deleted. A deleted line is
  never restored, because a run that puts one back re-creates the drift the
  strip removes. The note that a struck-through line is skipped is gone. It
  was the only place any skill spelled a strike, and that is how a run came to
  improvise one as a "clear" on sydevs/SahajAtlasWeb#266. It is replaced by
  the rule: never strike a line, because a blocker clears when its issue
  closes or a person removes the relationship.
- write-ticket: "keep every `Blocked by:` line" now means every unconverted
  line. A revise that finds the line gone has nothing to put back.
- implement-ticket: the dispatcher's own check covers the open native
  blockers as well as the `blocked` label. Reading the body only catches a
  line it has not converted yet.

The failure this prevents is a session that reads the old prose, sees the
line missing, and writes it back. That is one more echo pass at best. At
worst it revives a blocker a person has already cleared.

rule-delta: directives 87 → 87, none removed.

Closes #178

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The previous commit deletes a `Blocked by:` line once it becomes a
relationship. write-ticket's recheck mode found why a ticket waited by
reading that line, and a session cannot read native relationships
(#3), so by the time the last blocker closed, a recheck session had
nothing left in the body to check.

The dispatcher already holds the answer: `unblock-check` gathers every
blocked-by relationship. The recheck fire now carries the closed ones as
`flags.cleared` (`owner/repo#N`), buildRecord passes them through only
when present, and payload.mjs keeps only well-formed refs, so the field
can carry a reference and never instructions. write-ticket step 1 reads
it in place of the line. A date park names no blocker and is unchanged.

Found by the run that implemented #178.

Refs #178

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nt and the record

A failing Railway preview reached the loop as a bare context name. gather
dropped the commit status's target_url, requiredOnly reduced each advisory
row to a string, and buildRecord sent only {green, reason}. GitHub held the
deployment link and no session could reach it: no mcp__github__* tool
returns a commit status. So the advisory comment named `sahajcloud -
SahajCloud` and nothing more, and a fix-ci session on the same head could
not see the deployment at all.

Now each status row keeps target_url and description, requiredOnly returns
advisory rows as {name, kind, targetUrl} (a status's target_url, a check
run's details_url), the advisory comment links each name to its deployment,
and the dispatch record's ci carries advisory. The commentOnce key is still
built from names alone, so no advisory note already posted is posted again.

A target_url is whatever its poster set, so only an https URL is linked,
with parentheses escaped so the Markdown link cannot end early. Nothing here
reads Railway or needs a credential.

Failure prevented: a reviewer sees "sahajcloud - SahajCloud failed" and has
to go find the deployment by hand, and a session has no route to it at all.

Refs #164 (phase 1)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…read

Phase 1 carries a red Railway status's target_url into the record's
ci.advisory. That link holds the deployment id, and the deployment id is
what Railway's buildLogs and deploymentLogs queries take. Nothing parsed
it, and nothing said which statuses are Railway's or where the token lives.

Adds a `railway` key to loop-config.json, beside `sentry`: apiBase,
tokenEnvVar (the maintainer chose a project token, option A on #164),
statusContexts (`sahajcloud - SahajCloud`), and logLines. Adds
workflow/lib/railway.mjs: deploymentFrom() parses the one link shape
observed on SahajCloud#879, every id a UUID, https on railway.com or
railway.app only, since a status link is whatever its poster set.
failedDeploys() picks the advisory status rows the config lists.
readPlan() and the CLI give a session the apiBase, the header, whether the
token is set (never its value), and one GraphQL request per deployment
reading both its build log and its runtime log: a preview can build
cleanly and then fail its healthcheck.

The script never fetches and holds no credential. The session sends the
request, so the rule that no script here opens a connection still holds.
Nothing fires it yet; phase 3 does.

routine-setup.md names the token by its config key, not by spelling it,
and warns that Railway scopes a project token to one environment while
each preview runs in its own, with the two calls that check it.

Failure prevented: a session that has the deployment link still cannot
turn it into a log read without guessing the URL shape and the query.

Refs #164 (phase 2)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…its log

With phases 1 and 2 the record carries the failed preview's link and a
script turns it into a log read, but nothing starts a session to do the
read. A red status the ruleset does not require fired nobody, so a broken
preview build was said once and then left to the reviewer.

decide: when required CI is green and an advisory row is a preview that
railway.statusContexts lists, with a link that parses, the plan is the
advisory note plus fix-ci with flags.mode "deploy". There is no bumpFixCi
and no fixCi write, so the pass spends nothing against
ceilings.ciFixIterations or ciInfraReruns, and no ceiling value changes.
It fires once per head. The key reads record.current as well as
dispatches: the unlock that ends the pass is decided before apply moves
current into dispatches, and fire-time entries carry no flags, so keying
on ended entries alone would fire a second pass at that unlock.
endedFixCiFor now skips deploy passes, so a deploy pass on a head never
stands in for a repair pass there. No pass fires mid-phases, where the
next phase may be what fixes the build.

fix-ci/SKILL.md: a Deploy mode section. It carves the two standing rules
out (the advisory preview is this run's subject, and the dispatcher cannot
re-run it), runs railway.mjs, and degrades with no token to one comment
with the link plus a journalled missing credential. It reads the logs with
curl, since Railway is not GitHub, and names the token only through
railway.tokenEnvVar. A cause in the repo is fixed and pushed. A cause
outside it gets one comment naming the log line. A new hard rule: never
redeploy, restart or change anything on Railway, a vendor write. No new
allowed-tools grant: Bash(*) already covers curl, jq and printenv.
rule-delta: 87 -> 88 directives, nothing removed.

Failure prevented: on 2026-10-07 three SahajCloud previews failed while
the required tests passed, and the loop spent passes blind or said nothing.

Refs #164 — the ticket stays open until a token is shown to reach a preview and railway.readLogs is on.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Ardnived Ardnived changed the title fix(loop): close out the open tickets — lib gate, Storybook protection, roadmap verify, Blocked-by strip, Railway preview logs fix(loop): close out the open tickets, and fold in #159's preview data Oct 12, 2026
@Ardnived
Ardnived force-pushed the claude/outstanding-tickets branch from 4e9b95c to 230dbdf Compare October 12, 2026 23:49
Ardnived and others added 7 commits October 12, 2026 18:02
This PR changes workflow/skills, workflow/lib and adds a fix-ci mode, a
new capability, so the minor moves (cut-release/SKILL.md). An unchanged
version keeps every installed plugin on its cached skills however far
main moves.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…lock

endedFixCiFor looked for an ended fix-ci on the head in `dispatches` alone.
The unlock that ends a session is decided before apply moves `current`
into `dispatches`, so at that moment only the fire-time entry is there,
with no outcome. A pass that commented and stood down without pushing
therefore met red CI on the same head, and the unlock planned
`bumpFixCi` plus another `fix-ci` — the SahajAtlasWeb#245 loop, by a
second route, spending a ceilings.ciFixIterations pass each time.

The existing test passed only because it set `current: null`, which is
never the record an unlock sees. The ending session in `current` now
counts as ended, the way deployPassFor already reads it. A pass that
pushed has moved the head, so it still gets its repair. Seen red with
the `current` read removed.

Found while building the deploy pass for #164.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
#164 and the commits that built it assumed no mcp__github__* tool returns
a commit status, so the dispatch record was a session's only route to a
failing preview's link. That is wrong: `pull_request_read
method:get_status` returns the head's commit statuses, Railway's
included — merge-gate.mjs's header and docs/why.md's rung-1 history
already say so, and #159's step 7b reads the deploy status the same way.

It mattered for trust, not reach. A deploy pass read the deployment the
record named, so a forged or stale record could aim a token at another
deployment it reaches. Step 1 of deploy mode now keeps only a link that a
failing status from get_status also carries. The comments in fire.mjs,
merge-gate.mjs, railway.mjs and the why.md entry stop claiming the record
is the only route.

Refs #164

Co-Authored-By: Claude Opus 5.5 <[email protected]>
SahajCloud#874 shipped eighteen phases with Preview links into a database
that held only the preview admin, plus a manual-verification step naming a
CSV fixture that was never committed. The link rule checked the host and
the path, never whether the page showed the change.

finalize-pr step 7 gains "Every link opens on data": read back what each
link needs, seed what is missing with `previewUrl.seed`, carry the
reviewer's inputs in the body, and say so in one line when a link cannot
be backed by data yet. implement-issue step 10 and the PR template point
at it, and adversarial-review opens each Preview link and flags one that
shows nothing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A Railway host builds only after its PR opens, so the run that opens a
PR could never seed it, and a single-phase PR with a clean critic has no
later run before a human reads it. Step 7b allows the one bounded wait:
read the deploy status on the head SHA every `preview.pollSeconds`, for
at most `preview.deployWaitMinutes`, with one waiter and no CI reads.
Then seed, verify and refresh the body. On timeout, the
`Data: not seeded yet` line stands.

docs/why.md#push-and-end records the exception and why it cannot turn
back into the CI polling that rule replaced.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…deploy pass

#159's step 7b sent a failed preview deploy "to fix-ci through CI". A
Railway preview is a commit status the ruleset does not require, so it is
not CI: it reaches the dispatcher as an advisory, which now links the
deployment and, once railway.readLogs is on, fires a fix-ci deploy pass
(#164). Step 7b says so, so a run that times out on a red preview does
not go looking for a CI repair that will never be fired.

The foreground-sleep refusal step 7b works around is Claude Code's, not
one of this plugin's hooks; the line now says which.

Refs #159

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…always on

Railway's project-token form offers production or one existing preview
environment, never "any preview" (confirmed by the maintainer,
2026-10-12). Every PR gets a new environment, so a project token can never
reach the next preview. Only a workspace token can, and it authenticates
as `Authorization: Bearer`, not `Project-Access-Token`. The maintainer has
set one in the routines' cloud environment as RAILWAY_TOKEN.

So the deploy pass reads with that header and that variable name, and
nothing switches it off: a red preview with green required CI on a bot PR
always earns one read. With no token, or a refusal from Railway, the pass
comments the link and stops, as before.

fix-ci's deploy mode drops from five steps to four: the no-token case and
the Railway-error case are the same comment, so they are one step.
routine-setup.md §4 and the why.md entry say why a workspace token is the
only kind that works here, and that it reaches production too.

Closes #164

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Ardnived
Ardnived force-pushed the claude/outstanding-tickets branch from 230dbdf to 4fd1712 Compare October 13, 2026 01:03
@Ardnived
Ardnived merged commit 88640ff into main Oct 13, 2026
6 checks passed
@Ardnived
Ardnived deleted the claude/outstanding-tickets branch October 13, 2026 02:44
@sydevs-bot sydevs-bot moved this from Revising to Done in SYDevelopers Technical Roadmap Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment