Skip to content

probe: the gate ignores the branch copy of ci-ok (not for merge) - #837

Open
HugoXK wants to merge 4 commits into
mainfrom
probe/640-base-tree
Open

HugoXK wants to merge 4 commits into
mainfrom
probe/640-base-tree

Conversation

@HugoXK

@HugoXK HugoXK commented Nov 15, 2026

Copy link
Copy Markdown
Owner

Written-by: HugoXK

No-issue: mechanism probe for the #640 gate change; not for merge.

DO NOT MERGE. This pull request is the negative control the issue review asked for: it shows, in a live run, that the merge gate ignores a branch's own copy of its evaluator. Only the owner closes it.

Tip: 3afe696118b181841bdb2146ef90a39f73b8811b, tree 1e58d87fa966dcbc6668e33297a0546151c8b289.

What the branch does: rewrites scripts/ci-ok.mjs to process.exit(0) and adds src/probe-base-tree.ts with a deliberate type error.

What a correct gate does with it: ci-ok runs the base tree's copy, names that copy by blob sha in the log, and fails because typecheck failed. A gate that read the branch copy would report ci-ok green over a red branch, which is the defect the #640 change removes.

Ran:

  • Nothing locally on this branch: it is a negative control, and a green local run would contradict what it demonstrates.

Not run:

  • npm run check on this branch, for the same reason: typecheck cannot pass with the type error the branch adds.
  • Docker, live CodeQL analysis on a real diff, live DB/SMTP: untouched by a throwaway branch.

Risk and rollback: scripts/ci-ok.mjs is T3 by the risk rules, which is why this is a labelled probe and not a product change. Rollback is deleting the probe/640-base-tree branch; nothing on main depends on it.

Docs-not-needed: the branch is deleted after the demonstration and changes no product surface.

Changelog-not-needed: a mechanism probe is not a user-visible change.

maintainer_can_modify: true

Mechanism drill, not for merge. HEAD rewrites `scripts/ci-ok.mjs` to exit 0 and
adds a deliberate type error under `src/`. A pull request that judged itself
would report `ci-ok` green; the base-tree evaluator must report it red because
`typecheck` failed, and the log must name the base blob rather than this one.

Refs #640
@HugoXK HugoXK added the probe Mechanism probe: not for merge, owner closes it label Nov 15, 2026
Every evaluator that decides whether a pull request may merge was executed
from the pull request's own checkout, so a T3 diff could edit the code that
judges it. `review-gate` and `pr-lint` already checked the base ref out; the
aggregate and supply-chain gates did not.

`ci-ok`, `changes`, `risk`, `action-pins`, `workflow-lint` (the
workflow-injection scanner), `codeql-required` and the CodeQL result gate now
check the base branch out into `base/` and run `node base/scripts/<gate>.mjs`.
Only the data under test comes from the head: the diff (`--repo .`), the
workflow files, and the SARIF the analysis produced. The CodeQL baseline and the
workflow-injection allowlist are read from `base/`, so a pull request cannot
widen either.

The `changes` job also runs `scripts/gate-integrity.mjs`, which writes every
gate file in the diff into the job summary and fails closed when the diff cannot
be read.

Not moved: for a `pull_request` event GitHub fetches the workflow YAML from the
pull request, so a job's own `run:` lines are the head's text. That shape is
covered by the required check plus a T3 PASS on a diff the summary names; a
`workflow_run` aggregate is a separate slice.

Fixes #640
@HugoXK

HugoXK commented Nov 15, 2026

Copy link
Copy Markdown
Owner Author

Record only — do not merge.

Mechanism probe for the #640 gate change; its evidence is recorded in #836's body. The branch is the negative control: scripts/ci-ok.mjs exits 0 and src/probe-base-tree.ts carries a type error, and the live ci-ok run (43710167901, job 132800364004) still fails it while naming the base blob.

The branch stays as the record. Only the owner closes this pull request.

Written-by: Fledge Platform Dev-1

HugoXK and others added 2 commits November 15, 2026 11:50
The first CI run on this branch failed in `changes`: the base branch
(43210cf) predates `scripts/gate-integrity.mjs`, so
`node base/scripts/gate-integrity.mjs` was MODULE_NOT_FOUND on the pull request
that introduces the file.

The step now tests the base path, `[ -f base/scripts/gate-integrity.mjs ]`, and
writes a notice when it is absent. The guard reads the base tree, so a diff
cannot decide whether the summary runs; once the file is on `main` every later
pull request gets the summary. `test/gateBaseTree.test.ts` pins the base path,
and `docs/autonomous-dev.md` says why the guard exists.

Refs #640
A reviewer reading a run log could not tell which copy of `ci-ok` produced the
verdict: the base checkout is a second directory, and the branch's own copy of
the file still sits at the root. `ci-ok` now prints the blob the base tree holds
for `scripts/ci-ok.mjs` before it runs it, so the sha in the log names the file
the verdict came from, and a branch that rewrites the evaluator shows up as a
mismatch in its own run.

`docs/autonomous-dev.md` records the line and says it is evidence, not a gate.

Refs #640
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hold probe Mechanism probe: not for merge, owner closes it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant