Skip to content

Path-test the files of a cancelled push, and class .agents/** changes as docs only #759

Open

Description

@HMarzban

Summary

Two follow-ups from #562 and #563, under #554. Both are in the change-aware CI scopes.

  • A. Cancelled-push gap. A new push on main cancels the older run in its group. The next run diffs only its own push. So the files of the cancelled push are never path-tested by a push run. Today only the next (build): push (app gates) or the weekly cron (extension suites) tests them.
  • B. .agents/** class. A non-Markdown file under .agents/ matches no class, so it turns every scope on. A skill script edit then runs every app job.

Part A was ruled on 2026-11-16: force every scope after a cancel. Part B shipped in 98b9b002c (PASS=32).

Why

A. Cancelled-push gap

  • The workflow group is ${{ github.workflow }}-${{ github.ref }}-quality with cancel-in-progress: true (.github/workflows/prod.docs.plus.yml:68-70).
  • On a push, the extension filter and the scope list diff github.event.before..github.event.after. FORCE_ALL turns on only for a dispatch, the cron, or an all-zeros before (:175). ALL_SCOPES adds every (build): push (:211).
  • The weekly cron runs the security audit and every extension suite (:18, :39-41). It skips lint, Type Check and the other app gates (:224-227, :235-238).
  • Cancelled push runs on main, 2026-10-12 to 2026-11-11 (gh run list --status cancelled, read 2026-11-11): 4. Three ran on 2026-10-24, before Run only the CI suites a pull request or push can affect #563. One ran after Run only the CI suites a pull request or push can affect #563: run 42643193705 (2026-11-09).
  • Run 42643193705 finished every gate before it was cancelled. Only 🚀 Deploy Production and two later jobs were cancelled. The next push, run 42643542728, logged Detected 0 changed files. So no file went untested this time.
  • The husky pre-push hook runs bun run check:ci ([Tracking] Faster, change-aware CI/CD pipeline #554 SP2). That covers local gates, not the browser or extension suites on a runner.

B. .agents/** class

  • .github/scripts/detect-change-scopes.sh:32 classes any *.md path as docs, so .agents/skills/*/SKILL.md is docs.
  • Any other file under .agents/ reaches the unmatched arm (:54), which turns on webapp, admin and backend.
  • Runs 42662047020 and 42662791796 (2026-11-09) each logged unmatched .agents/skills/release-product/scripts/note-coverage.ts. Each ran Type Check, Webapp Unit Tests and Build Verification. M6 was 245 s and 229 s (Run only the CI suites a pull request or push can affect #563 review, Measure CI/CD time to live after the v2.3 work: 1090 s median before #569 M6 rule).
  • The lint job runs bun run lint, bun run format and bun run lint:styles on every push (.github/workflows/quality-lint.yml:24-27). check:agent-docs is part of bun run check (package.json:53), not of the lint job.

Decision (maintainer)

  1. How to close the gap? Ruled 2026-11-16: force every scope after a cancel (ruling).
    • Recommended: force every scope after a cancel. Detect Changes reads the previous push run on this branch with gh api. If it ended cancelled before all its gates completed, set FORCE_ALL and ALL_SCOPES. It is fail-safe, like the unmatched rule. It costs one full run per such cancel (1 since Run only the CI suites a pull request or push can affect #563).
      • Read gate jobs, not the run conclusion. The new run starts seconds after the push, so the previous run can still be in_progress: a job under always() keeps running ([Tracking] Faster, change-aware CI/CD pipeline #554 SP1). Force every scope when the previous push run is not completed, or completed as cancelled, before all its gate jobs ended.
    • Other: diff from the head SHA of the last push run whose gates all completed. It tests only the missed files, but it needs a SHA search and a fallback for a missing run.
    • Not enough alone: cancel-in-progress: false on pushes. GitHub still replaces a pending run in the group, so the gap stays for queued pushes.

What to change

  1. Agent in the repo, part B first. Confirm that no gate except lint reads .agents/**. Check the typecheck workspace list, the unit test globs, and apps/webapp/docker/Dockerfile.bun, apps/admin-dashboard/docker/Dockerfile.bun, apps/hocuspocus.server/docker/Dockerfile.bun and .dockerignore. grep -n '\.agents' apps/*/docker/Dockerfile.bun .dockerignore must print nothing (it printed nothing at 0b302b222). Post the result here.
  2. Agent in the repo. In .github/scripts/detect-change-scopes.sh, add .agents/* to the docs arm at :32. Update the scope table in .github/WORKFLOWS.md (detect-change-scopes.sh:4 says they stay in step). Add one case to .github/scripts/detect-change-scopes.test.sh for a .agents/skills/<name>/scripts/<file>.ts path. Expect PASS=32 FAIL=0.
  3. Maintainer ruling on the Decision above. Ruled 2026-11-16: force every scope after a cancel.
  4. Agent in the repo, part A. Build the ruled option in the 🔎 Detect Changes job. Print one line, reason=forced-after-cancel, when it fires. Grant the job actions: read only. Add a test case if the logic lives in a script. Add a test case for an in_progress previous run.
  5. Agent in the repo. Add a Rollback line to Stop extension README media from triggering extension test suites #562 and Run only the CI suites a pull request or push can affect #563: "Scopes read before..after. Since Path-test the files of a cancelled push, and class .agents/** changes as docs only #759, a run after a cancelled push forces every scope."
  6. Maintainer. Commit through the commit-review skill. Run [Tracking] Faster, change-aware CI/CD pipeline #554 SP1, then push.

Benchmark

Field Value
Metric (a) Files of a cancelled push run that no later push run path-tests (exact). (b) App jobs (Type Check, Webapp Unit Tests, Build Verification) on a change to .agents/** only (exact). (c) M6 (#569) of that change, in seconds
Before (a) structural gap; 0 files missed so far (1 cancelled push run since #563, run 42643193705, finished its gates). (b) 3 of 3, runs 42662047020 and 42662791796. (c) 245 s and 229 s, n = 2 push runs, 2026-11-09 (a hint, not a result)
After not measured yet
Condition GitHub-hosted ubuntu-latest, prod.docs.plus.yml with this change. (a) the first live push after a cancelled push run. If no cancel happens by the v2.3.7 release audit, record (a) as "not measured"; the step 4 test case proves the rule. (b), (c) come from the #563 docs-only draft PR, with no separate PR. That PR edits one root .md line and one comment line in one .agents/skills/ script, and it closes unmerged. Since 98b9b002c, an .agents/** path is in the docs class, so both edits run the same job set. A docs-only draft PR run counts in place of a push (#563 ruling of 2026-11-06)
How to run (a) gh run view <next run> --log | grep -E "reason=|unmatched|docs ". (b), (c) read the 5 runs of the #563 docs-only draft PR. M6 from each run createdAt (#569). Never take n = 5 from reruns
Pass rule (a) the first run after a cancelled push prints reason=forced-after-cancel, or lists every file of the cancelled push. (b) 0 of 3 on 5 of 5 runs. (c) median 120 s or less, n = 5, with min–max. Stop rule: revert part B if any .agents/** change breaks a gate on main that lint did not catch
Guard The weekly cron stays green. detect-change-scopes.test.sh prints FAIL=0
Owner Steps 1, 2, 4, 5: agent in the repo. Steps 3, 6, the #563 docs-only draft PR and the live read: maintainer
Claim Internal: "A skill script edit now runs 0 build or test jobs, down from 3, and passes CI in s, down from 229-245 s. No push's files skip their tests after a cancel."

Related

#554 (tracker), #562 and #563 (change-aware CI, Rollback text), #569 (M6 definition and sample rules), #557 (CI failure alerts).

Activity

  1. added this to the v2.3.6 milestone on Nov 11, 2026
  2. added
    github_actions
    on Nov 11, 2026
  3. HMarzban commented on Nov 14, 2026

    @HMarzban
    CollaboratorAuthor

    Moved to v2.3.7 at the v2.3.6 release audit. The before is posted, but no after is measured, and the part A ruling is not set yet.

  4. modified the milestones: v2.3.6, v2.3.7 on Nov 14, 2026
  5. HMarzban commented on Nov 16, 2026

    @HMarzban
    CollaboratorAuthor

    Measured, 2026-11-16

    Part B, steps 1 and 2, committed in 98b9b002c. Part A waits for the step 3 ruling.

    Step 1: no gate except lint reads .agents/**

    • grep -n '\.agents' apps/*/docker/Dockerfile.bun .dockerignore printed nothing (exit 1), at 684612c14.
    • The three Dockerfiles COPY named paths only. None copies . or .agents.
    • Root workspaces are apps/*, extensions/*, packages/*. typecheck is bun run --filter '*' typecheck, so .agents is not in it.
    • Root tsconfig.json includes only packages/**, apps/**, extensions/**. No tsconfig, jest or bunfig file names .agents.
    • Webapp Unit Tests run jest in apps/webapp. Backend tests run bun test in apps/hocuspocus.server. .agents has no test files and no src/ paths.
    • No workspace code imports from .agents. The one link runs the other way: qr-svg.ts imports apps/webapp/src/utils/qrCodePaths.ts.
    • No workflow reads .agents. ESLint (eslint .) and Prettier (house skills) do, and both run in the lint job on every push. check:agent-docs runs only in local bun run check.

    What changed

    • .github/scripts/detect-change-scopes.sh: .agents/* joins the docs arm. A path under a src/ folder still skips it, so it stays fail-safe.
    • .github/WORKFLOWS.md: row 2 of the scope table lists .agents/**, with one sentence on why.
    • .github/scripts/detect-change-scopes.test.sh: new case agents-skill-script for .agents/skills/release-product/scripts/note-coverage.ts.

    Before and after

    Metric Before After Change n, range Condition Source
    Scopes on for one non-Markdown .agents/** path 3 of 3, docs_only=false, logged unmatched 0 of 3, docs_only=true, logged docs 100% fewer n = 2 non-Markdown paths (note-coverage.ts, schedule.json), 3-3 before, 0-0 after; SKILL.md is a control, 0 of 3 before and after; plus 1 combined run of 3, 3 of 3 before, 0 of 3 after local bash, synthetic list, FILE_COUNT set, at 684612c14 before the edit and with it after script output
    App jobs that follow (Type Check, Webapp Unit Tests, Build Verification) 3 of 3 0 of 3 100% fewer derived from the rows above WORKFLOWS.md job table, not a live run script output
    detect-change-scopes.test.sh PASS=31 FAIL=0 PASS=32 FAIL=0 +1 case n = 1 run each local bash test output

    The synthetic paths were note-coverage.ts, tech-writer/SKILL.md and x-posts/references/schedule.json. SKILL.md was already docs before. Two guards hold after: .agents/skills/x/src/a.ts stays unmatched, and .agents plus a webapp file still turns webapp on.

    Metrics (b) and (c) on a live run are not measured yet. The live before stays as posted: runs 42662047020 and 42662791796, M6 245 s and 229 s.

    Gates

    Command Result
    bash .github/scripts/detect-change-scopes.test.sh pass, PASS=32 FAIL=0
    bunx prettier --check --ignore-unknown .github/WORKFLOWS.md .github/scripts/detect-change-scopes.sh .github/scripts/detect-change-scopes.test.sh pass
    shellcheck .github/scripts/detect-change-scopes.sh .github/scripts/detect-change-scopes.test.sh pass
    actionlint, ESLint, typecheck not run: no workflow, TS file or workspace touched

    Step 5 draft (not posted)

    The issue's Rollback line describes part A, which is not built. Post it on #562 and #563 only after step 4 ships: "Scopes read before..after. Since #759, a run after a cancelled push forces every scope."

    Until then, this part B line is true. It is proposed text, not text from this issue: "Scopes read before..after. Since #759, a change under .agents/** counts as docs."

    Left

  6. HMarzban commented on Nov 16, 2026

    @HMarzban
    CollaboratorAuthor

    Maintainer ruling, 2026-11-16

    Answered by the maintainer in the 2026-11-16 working session; posted by the agent.

    • Part A: force every scope after a cancel. When the previous push run was cancelled, or not completed, before all its gates ended, set FORCE_ALL and ALL_SCOPES.
  7. HMarzban commented on Nov 16, 2026

    @HMarzban
    CollaboratorAuthor

    Review, 2026-11-16 (maintainer approved).

    • (b) and (c) now come from the Run only the CI suites a pull request or push can affect #563 docs-only draft PR. That PR edits one root .md line and one .agents/skills/ script comment line. The separate 5-run draft PR is cut. Since 98b9b002c, both paths run the same docs-class job set.
    • Condition (a) now names the v2.3.7 release audit, not v2.3.6.
    • The Decision and step 3 record the 2026-11-16 part A ruling: force every scope after a cancel. Build it as ruled, with the in_progress test case.
    • The Summary records that part B shipped in 98b9b002c (PASS=32).
  8. HMarzban commented on Nov 17, 2026

    @HMarzban
    CollaboratorAuthor

    Measured, 2026-11-17

    Part A, step 4, built as ruled on 2026-11-16: force every scope after a cancel. Committed in 58f22a844 and pushed 2026-11-17 (first run 44025904215). Part B stays in 98b9b002c.

    What changed

    • .github/scripts/detect-cancel-gap.sh (new): reads the previous push run and its jobs on stdin. It prints force and one reason line.
      • The run completed and was not cancelled: force=false, reason=previous-run-ended.
      • The run was cancelled or is not completed, and every gate job completed and was not cancelled: force=false, reason=previous-gates-ended.
      • Otherwise: force=true, reason=forced-after-cancel. This covers a gate job that is in_progress or cancelled, and a run with no jobs.
      • No previous push run: force=false, reason=no-previous-run. Unreadable input: force=true, reason=forced-unreadable-run (fail-safe).
      • Gate jobs are all jobs except the deploy chain and the run report. A renamed deploy job counts as a gate, so a rename can only force more.
    • .github/workflows/prod.docs.plus.yml, 🔎 Detect Changes: a new gap step on push only. It reads the previous push run on the same branch with gh api (highest run_number below this run). steps.gap.outputs.force joins FORCE_ALL and ALL_SCOPES. The job gains actions: read only.
    • .github/scripts/detect-cancel-gap.test.sh (new): 11 cases. They include the in_progress case the review names (in-progress-gate) and its control (in-progress-deploy-only).
    • .github/WORKFLOWS.md: one paragraph under Change scopes, and one Related files line.

    Before and after

    Metric Before After Change n, range Condition Source
    Cancelled push runs on main, cut before their gates ended, whose next push run forces every scope 0 of 3 3 of 3 +3 n = 3 runs (40072775778, 40072782268, 40072862372), 2026-10-24 replay: the gap step run locally against the live API, with RUN_NUMBER set to the next run, and created<= added to reach old runs step output, reason=forced-after-cancel
    Cancelled push runs on main whose gates all ended, forced anyway 0 of 2 0 of 2 none n = 2 runs (42643193705, 2026-11-09; 43224277563, 2026-11-12) same replay step output, reason=previous-gates-ended
    detect-cancel-gap.test.sh none PASS=11 FAIL=0 new n = 1 run local bash test output
    detect-change-scopes.test.sh (guard) PASS=32 FAIL=0 PASS=32 FAIL=0 none n = 1 run each local bash test output

    "Before" is the rule at 5aa56e1d1. There, FORCE_ALL turns on only for a dispatch, the cron, or an all-zeros before, so no push run forced after a cancel. The 5 runs are every cancelled push run on main from 2026-10-12 to 2026-11-17 (gh run list --status cancelled). Run 40072862372 was cancelled while queued and has no jobs. Two more replays held: run 800 printed reason=previous-run-ended, and run 1 printed reason=no-previous-run.

    Metric (a) on a live run is not measured. No push has been cancelled since this change. If none happens by the v2.3.7 release audit, record (a) as "not measured". The test cases prove the rule.

    Gates

    Command Result
    bash .github/scripts/detect-cancel-gap.test.sh pass, PASS=11 FAIL=0
    bash .github/scripts/detect-change-scopes.test.sh pass, PASS=32 FAIL=0
    bun fmt --check --ignore-unknown on the 4 files pass
    actionlint .github/workflows/prod.docs.plus.yml pass
    shellcheck on the 2 new scripts pass
    ESLint, typecheck not run: no TS file or workspace touched

    Left

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    DevOpsgithub_actions

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions