Repository navigation
fix(ci): pin Pi to 0.87.1, widen parallel shard caps, fix livecheck guard - #2
Merged
Merged
Conversation
…mpt quoted titles The live-status Stop hook blocked a reply twice over a false positive: the reply named a 2015 Confluence page titled "TEP-22: Trends Service", the hook read TEP-22 as a Jira key, and the suggested bin/fm-verify-items.sh run came back "jira TEP-22 error twg lookup failed (exit 1)" because no such issue exists. The hook refused to count that error line, so nothing could satisfy it and only the per-session budget ended the turn. Two changes, both captain-approved: 1. A lookup that ran counts whatever it answered. fm_livecheck_verified no longer drops a record whose tool result is an error, and a verifier result line counts in every state except unverified: error means the lookup ran and failed (not found, no access, outage), which is the live answer the reply then reports; unverified means no backend could look at all, so no lookup ran. The current-turn requirement is unchanged. 2. Keys inside quoted text are not claims. The tokenizer now skips a double-quoted span (straight or curly) that opens and closes on one line, and the text of a Markdown link whose target is a Confluence or wiki page (host containing "confluence" or "wiki", or a path under /wiki/, /confluence/, or /display/). The link target is still read, an unbalanced quote exempts nothing, and bare keys, inline code, and ordinary prose remain claims. docs/livecheck-guard.md states the exact rule. Regression: the TEP-22 case end to end (quoted-title reply with no lookup allows, the same key bare still blocks, the failed verifier run allows and resets the budget), the extraction rules above, and the verifier error versus unverified line distinction.
…me from one bug in the livecheck code, and I fixed it. The other two and the attestation check are not caused by this PR. **Fixed (serial 2 and serial 3).** The set passed to `tr -c` in `fm_livecheck_tokens` ended in `+-\n`. GNU `tr` on the Ubuntu runner reads that as a reverse range and fails with "range-endpoints of '+-\012' are in reverse collating sequence order" (read from the CI log). The tokenizer then returned nothing, so `fm_livecheck_extract_items` printed no items. That broke two tests: - `tests/fm-livecheck-guard.test.sh`, "extraction must canonicalize each kind once" (serial 2): got `''`. - `tests/fm-verify-items.test.sh`, "one unreadable item must make the exit status 1" (serial 3): `fm-verify-items.sh` exited 2, its "no recognizable work item" code. I inferred this link from reading `bin/fm-verify-items.sh` (it exits 2 when extraction is empty); I did not see that error message in the log. macOS BSD `tr` tolerates the old set, so the tests passed locally. The change is one line in `bin/fm-livecheck-lib.sh`: the set now ends `%+\n-`, with `-` last. I checked the new set with GNU `tr` (`gtr`) on sample text and it tokenizes correctly. After the edit, `tests/fm-livecheck-guard.test.sh` and `tests/fm-verify-items.test.sh` pass locally. I could not run the GNU `tr` path through the full test scripts, so serial 2 and 3 are confirmed only by that check plus reading the code, not by a CI rerun. **Not caused by this PR (no change made).** - **Serial 1 and serial 4:** the failing tests are "Pi calm renderer and lifecycle contract" and "Pi outcomes rendering consumers must preserve stock behavior", plus a "stalled-crew escalation was not counted" failure in serial 1. The two Pi failures also failed in the CI run on `main` (run 38220189770), and the livecheck PR did not touch them. I did not look into the stalled-crew failure separately. - **"PR must be raised via no-mistakes":** the job log shows `PR_BODY`, `PR_HEAD_SHA` and `PR_NUMBER` all empty, and the check says no pipeline attestation was found. This is an attestation check, not a code defect. It should clear once the no-mistakes pipeline updates the PR. - **Behavior portable parallel 1:** it was cancelled with no verdict, so it was not a failure. I left it, as it was not in the selected findings
…hich I fixed. Serial 1 and 4 fail in code this PR does not touch. **Serial 2 (fixed).** - The tr fix from round 1 worked: serial 3 passed in run 38226059349, and the "extraction must canonicalize" test no longer failed. - That fix exposed a failure that the earlier one had hidden. Serial 2 now failed at "a capped window with no prompt yields the tail's own (empty) records (expected '0', got '1')" in `tests/fm-livecheck-guard.test.sh` (read from the CI log). - Cause: the fixture `test_turn_records_grow_the_tail_window` passed a 300 KB string to `jq --arg`. Linux limits a single argument to about 128 KiB, so jq failed with "Argument list too long" and the fixture was never built. macOS has no such limit, so it passed locally. - I reproduced it in an `ubuntu:24.04` Docker container (observed in an experiment): the same "expected '0', got '1'" failure, with the jq error printed above it. - Fix: the fixture now builds the noise entries with the `printf` builtin, which has no exec argument limit. - After the fix, `tests/fm-livecheck-guard.test.sh` and `tests/fm-verify-items.test.sh` both exit 0 in the same Ubuntu container. I did not run them locally on macOS after the edit. **Serial 1 and serial 4 (not caused by this PR, no change).** - Serial 1 failed on "Pi calm renderer and lifecycle contract". Serial 4 failed on "Pi outcomes rendering consumers must preserve stock behavior". - Both also failed in the run on main (38220189770, commit 68d66ad), and this PR changes only `bin/fm-livecheck-guard.sh`, `bin/fm-livecheck-lib.sh`, `docs/livecheck-guard.md` and `tests/fm-livecheck-guard.test.sh`. - I did not investigate why they fail. Serial 1's log also showed a "stalled-crew escalation was not counted" failure that I did not look into. **Behavior portable parallel 1.** It was cancelled with no verdict, and run 38226059349 itself ended as cancelled, so I left it alone
…ry form the guard prints in its fix command. The guard prints bound refs as `owner/repo#N` (e.g. `'a/b#4'`), but `fm_livecheck_extract_items` in `bin/fm-livecheck-lib.sh` only recognized bare `#N`, so the verifier exited 2 ("no recognizable work item"). I added a `repo_ref_pat` branch to the extractor that emits `ref owner/repo#N`; it canonicalizes the same way as a bare ref bound to a repo, so duplicates still collapse. Regression test `test_hook_printed_command_is_accepted_by_the_verifier` in `tests/fm-livecheck-guard.test.sh` runs the real hook on a reply naming an issue URL, a bare `#4`, a PR URL, a Jira key and a Jenkins build URL. It extracts the command the banner prints and runs the real `fm-verify-items.sh` with a failing fake `gh`. It asserts the exit status is not 2 and that every item gets a lookup line. Before the lib change the verifier rejected the printed command with exit 2 (observed in an experiment; the test then failed on the missing `a/b#4` line). `tests/fm-livecheck-guard.test.sh` and `tests/fm-verify-items.test.sh` both exit 0 locally on macOS. I did not run them on Linux. I briefly used a path-limited `git stash push` mid-session and restored it with `git stash apply` and a drop. The working tree contains only the two intended changes
…k-lib.sh` (header), `bin/fm-verify-items.sh` (header) and `docs/livecheck-guard.md` now say the extractor and verifier accept an explicit `owner/repo#N` reference as written, which is the form the guard banner prints in its fix command. They previously described only bare `#N`. I ran `tests/fm-livecheck-guard.test.sh` locally on macOS after the edit and it exits 0. The edits are comments and Markdown, so no code behavior changed
…30 minutes Three checks were red on every run of this PR and on main at 68d66ad while every other check passed. Behavior portable serial 1 and serial 4 failed in the Pi extension tests. CI installs @earendil-works/pi-coding-agent unpinned, and Pi moved from the 0.8x line to 1.1.0 since this fork's merge-base with upstream (2026-09-09). Pi 0.99.0 changed the stock tool-header rendering that tests/fm-pi-branch-extension.test.sh compares against, and Pi 1.0.1 renamed the HTML export renderer lookup that tests/fm-calm-pi-extension.test.sh drives. Measured locally on 2026-10-12 with FM_PI_PACKAGE_DIR and the version's pi on PATH: both tests pass on 0.87.1 (13 and 42 cases), the branch test fails on 0.99.2, and both fail on 1.1.0 exactly as on CI. Upstream adapted the extensions and tests in kunchenguid#6162, kunchenguid#6338, and kunchenguid#6530, which sit on 25 extension commits this fork does not have, so they do not cherry-pick cleanly. Pinning CI to the last 0.8x release, which is what the fork's extensions target, is the fix that fits this PR; the doc records that lifting the pin means taking upstream's changes. Behavior portable parallel 1 was cancelled by its own 10-minute job cap while still passing: on 2026-10-12 runs the shard needs about 10 minutes (fm-captain-hold-lifecycle 287 s, fm-lint 163 s, fm-test-run 89 s), far past the "about three minutes" the cap was sized for. Both parallel shards now use the same 30-minute hang-tripwire tier as the serial shards, which is also upstream's policy since kunchenguid#4910.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
Make #2 green, as the captain asked, without touching main: the two Pi extension tests (Behavior portable serial 1 and 4) fail only because CI installs @earendil-works/pi-coding-agent unpinned and Pi 0.99/1.x changed the stock tool-header rendering and the HTML export renderer lookup the fork's extensions and tests target, so CI pins the last Pi 0.8x release (0.87.1), the version both tests are measured to pass on; and Behavior portable parallel 1 was cancelled by a 10-minute job cap sized for a three-minute shard that now takes about ten, so both parallel shards move to the same 30-minute hang-tripwire tier as the serial shards (upstream's policy). Deliberate choices: pin rather than cherry-pick upstream's Pi adaptations (kunchenguid#6162, kunchenguid#6338, kunchenguid#6530), which conflict with this fork; do not change the Pi extensions or tests themselves; document the pin and the measured shard wall in docs/fm-test-portable-shards.md. The earlier commits on this branch fix the live-status Stop hook (count a lookup that ran whatever it answered, exempt quoted titles and Confluence link text, accept owner/repo#N in the verifier) and are already validated.
What Changed
.github/workflows/ci.ymlnow installs@earendil-works/pi-coding-agent@0.87.1instead of the floating latest, in both the portable parallel 1 job and the serial shard job.docs/fm-test-portable-shards.mdgains a "Pi package pin" section explaining the pin. Both parallel shards go from a 10-minute to a 30-minutetimeout-minutes, the same tier as the serial shards. The doc's timeout table records the measured shard wall.bin/fm-livecheck-lib.shchanges how the guard counts lookups and extracts work items:owner/repo#N, the form the guard prints in its fix command.trcharacter set is fixed so GNUtron Linux accepts it.bin/fm-livecheck-guard.shandbin/fm-verify-items.share adjusted to match.tests/fm-livecheck-guard.test.shadds regression tests for these cases. Its fixture builds large input withprintfto stay under the Linux per-argument size limit.docs/livecheck-guard.mdis updated to match.Risk Assessment
✅ Low: The CI changes pin both Pi installs to 0.87.1 and raise both parallel shard caps to 30 minutes, with the pin and shard wall documented. This matches the stated intent and leaves the Pi extensions and tests untouched. I did not run the CI or the tests.
Testing
I parsed the workflow YAML, then ran the two Pi extension tests against a real Pi 0.87.1 install in a temp directory. Both passed with no
not oklines; the temp install is removed. The remote runner, the 10-minute-to-30-minute cancellation behavior, and the earlier livecheck commits were not exercised here.npm install -g @earendil-works/pi-coding-agent@0.87.1pi --versionprinted 0.87.1; tests/fm-pi-branch-extension.test.sh printed ok lines onlyEvidence: Workflow job timeouts and Pi install pins (parsed YAML)
Source: Workflow job timeouts and Pi install pins (parsed YAML)
Evidence: Pi 0.87.1 test run output
Source: Pi 0.87.1 test run output
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
npm install -g @earendil-works/pi-coding-agent@0.87.1pi --versionprinted 0.87.1; tests/fm-pi-branch-extension.test.sh printed ok lines onlyParsed .github/workflows/ci.yml with Ruby YAML and listed each job's timeout-minutes and Pi install commandInstalled @earendil-works/pi-coding-agent@0.87.1 into a temp prefix and ranFM_PI_PACKAGE_DIR=<that package> bash tests/fm-pi-branch-extension.test.shSame setup:bash tests/fm-calm-pi-extension.test.sh(includes the native E2E and the HTML export renderer guard)✅ **Document** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.