Skip to content

test: use portable awk fixture appends - #5684

Open
ironerumi wants to merge 1 commit into
kunchenguid:mainfrom
ironerumi:fm/upstream-1242-bsd-sed-fixture
Open

ironerumi wants to merge 1 commit into
kunchenguid:mainfrom
ironerumi:fm/upstream-1242-bsd-sed-fixture

Conversation

@ironerumi

@ironerumi ironerumi commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Intent

The developer reproduced upstream issue #1242 and asked for its proposed fix to be sent as a pull request. On macOS the bearings snapshot test aborts partway through: two fixture appends in tests/fm-bearings-snapshot.test.sh use sed's a\ form with the appended text not terminated by a newline in the script, and BSD sed resolves that by gluing the input line following the match onto the appended text. In the sshhip fixture the first append consumes the blank separator and the second merges "## Queued" into the unreadable-child item, so the section header disappears. The issue body's own proposal, which the developer approved, replaces both appends with the portable awk form awk '{print} /pattern/{print "..."}', which appends on its own line under GNU and BSD sed alike. The change is deliberately limited to that one test file, with nothing under bin/, to keep the pull request lean. The developer also noted that the only comment on the issue is confusing; it is an automated triage stamp carrying no scope content.

What Changed

  • Replace two non-portable sed append commands in the bearings snapshot fixture with awk line insertion.
  • Keep fixture output consistent across BSD and GNU environments.

Risk Assessment

✅ Low: The change is narrowly scoped to replacing two non-portable fixture appends with portable awk commands and matches the stated intent.

Testing

The targeted snapshot test passed, and the evidence reproduces the BSD sed header-gluing failure while confirming the awk replacement preserves the section header. No runtime product surface changed.

  • Live validation: ⚠️ no-surface - 0 of 2 scenarios driven live against the product
Scenario Result Live Evidence
Run the mixed-domain bearings snapshot with portable fixture appends ⏸️ untested no The target changes only a test fixture file and introduces no end-user runtime surface for live driving.
Adversarially reproduce BSD sed header loss and verify the awk replacement ⏸️ untested no This is a test-portability scenario rather than an end-user product flow; no live product surface was changed.
Evidence: Bearings BSD sed validation

Source: Bearings BSD sed validation

== targeted bearings snapshot test ==
ok - task teardown during metadata capture is omitted without aborting the snapshot
ok - current state and decision hints share one captured status observation
ok - reused live state is discarded when task generation changes
ok - large local snapshot overlaps local reads with byte-identical serial and concurrent projections
ok - remote ledgers collect concurrently under one budget, reuse aged cache, and cancel wedged collectors
ok - a missing remote ledger stays explicitly unreadable without remote summary computation
ok - Domain Alpha structured state overrides a stale parent Phase 7 event
ok - GNU stat file reads select -c without BSD filesystem-report pollution
ok - parent activity evidence is bounded and disclosed
ok - Bearings excludes a status-only child decision
ok - a structured child captain hold reaches Captain's Call
ok - missing, invalid, unreadable, malformed, and unavailable-child homes stay explicit unknowns
ok - oversized ledgers stay strict unknown
ok - secondmate and per-home child counts are bounded, disclosed, and explicitly expandable
ok - parent decisions remain untrusted contradiction evidence
ok - parent evidence reconciliation distinguishes matching holds, blocks, and decisions
ok - nonprogressing child states are explicit and inconsistent terminal rows invalidate
ok - registry unavailability and bounded truncation remain explicit
ok - repeated snapshots keep the same current landed baseline and ignore prior reports
ok - default output is bounded, local-only, and marks omitted surfaces
ok - TOON and JSON are parity representations of the same model
ok - landed includes secondmate-managed merges alongside main-home merges
ok - landed accepts only kind-owned delivery artifacts while answered questions stay out
ok - kind fallback matches tasks-axi word boundaries and preserves scout deliveries
ok - kindless v1 summaries retain report artifacts from fresh and cached ledgers
ok - default landed selection balances one dominant home with sparse homes
ok - landed selection refills capacity after sparse homes exhaust
ok - landed selection uses deterministic home order when homes exceed the cap
ok - landed selection preserves deterministic home and internal tie ordering
ok - landed selection handles no landed items
ok - --all-landed keeps the complete global landed output
ok - landed stays bounded with per-home + overall caps and omitted[] disclosure
ok - Bearings keeps a live blocker in structured live state and never converts it to Charted Next queue work
ok - action-free items (working/done/queued/landed) do not leak into Captain's Call
ok - main orphan in-flight stays out of Underway and is disclosed in omitted/gates
ok - main unstructured current is disclosed while structured siblings still project
ok - counterfactual meta clears main inventory warning and projects the live task
ok - working captain holds retain main and secondmate bucket surfaces
ok - active children reach Underway independently of a home captain hold
ok - blank legacy summary names use their durable identifier
ok - newest filed gates are selected before snapshot bounds
ok - Underway rows carry the durable task name and gates carry their filed date
ok - mixed secondmate roles, partial state, and captain readiness project independently
ok - main and secondmate captain actionability use the same blocker readiness
ok - a completed scout with decision-like report prose is a pointer, not pending
ok - an authoritative captain hold surfaces end-to-end
ok - current report pointers surface
ok - queued body prose never hides an item from the board
ok - --include-prs is the only path that fetches, and it enriches correctly
ok - --include-prs maps a custom branch-prefix PR back to its recorded task
ok - a partial GitHub failure degrades gracefully
ok - Perl fallback bounds stalled GitHub calls without coreutils timeout
ok - all fleet-sized sections are capped with counted opt-in expansion
ok - captain-held tasks of any kind reach Captain's Call, deferral is honored, and landed excludes answered calls
ok - structured hold buckets decide Captain's Call, Charted Next, and the reveal
ok - a blocked deferred hold stays gated when its date arrives and is revealed by --all-decisions
ok - revealed deferred holds display their deferral reason while live calls stay unannotated
ok - live PR enrichment caps repositories with counted expansion
ok - per-repository open-PR caps are disclosed with an expansion knob
ok - projection and TOON rendering failures exit nonzero with diagnostics
== BSD sed regression fixture ==
legacy BSD sed result: ## Queued header was glued away (reproduced)
awk replacement result: ## Queued header preserved on its own line
- Outcome: ⚠️ 1 warning across 1 run (25m12s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

⚠️ **Test** - 1 warning
  • ⚠️ this change has no live-validatable surface; proceed without live validation? (0 of 2 scenarios were driven live against the product); Run the mixed-domain bearings snapshot with portable fixture appends: The target changes only a test fixture file and introduces no end-user runtime surface for live driving.; Adversarially reproduce BSD sed header loss and verify the awk replacement: This is a test-portability scenario rather than an end-user product flow; no live product surface was changed.
  • Live validation: ⚠️ no-surface - 0 of 2 scenarios driven live against the product
Scenario Result Live Evidence
Run the mixed-domain bearings snapshot with portable fixture appends ⏸️ untested no The target changes only a test fixture file and introduces no end-user runtime surface for live driving.
Adversarially reproduce BSD sed header loss and verify the awk replacement ⏸️ untested no This is a test-portability scenario rather than an end-user product flow; no live product surface was changed.
  • /bin/bash tests/fm-bearings-snapshot.test.sh
  • BSD sed regression reproduction and awk replacement verification
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

Closes #1242

The two fixture appends used sed's a\ form with no trailing newline in the
script. BSD sed resolves that by gluing the next input line onto the appended
text, so the sshhip fixture lost its blank separator and the second append
merged "## Queued" into the unreadable-child item, dropping the section
header.

Replace both with awk '{print} /pattern/{print "..."}', which appends on its
own line under GNU and BSD sed alike.

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate:

Verdict: Diff reviewed (two sed a\ fixture appends in tests/fm-bearings-snapshot.test.sh → portable awk '{print} /pattern/{print "..."}'). Closes ready-for-pr #1242 (Closes verified; BSD sed glued ## Queued onto appended line; suite aborts on macOS; nothing under bin/).

contract-class: restore — existing test fixture path broken on BSD sed; portable awk restores intended backlog shape. Test-only; no runtime product surface.

VISION: Honesty/scripts — aligns (portable fixtures). Authority/restart/spine/vendor — n/a or align. Scope — aligns (test hygiene).

Attestation: MATCH 2df2a312c5e7332c5cdf0366b29834bfc6ca6902 (live_validation no-surface). First-time fork CI: approved workflow runs 36156410910 (CI), 36156410903/36157183250 (Require no-mistakes) after diff review — no security risk. Firstmate flag: no. Waiting on: CI (not captain).

ironerumi added a commit to ironerumi/firstmate that referenced this pull request Nov 23, 2026
What: fixture-only changes so upstream suites pass on a macOS operator host
and in a live home: awk instead of BSD sed appends, a GNU stat shim
(fm_fake_gnu_stat), FIFO gates instead of sleeps, PATH_MAX-aware paths,
/tmp symlink canonicalization, APFS directory order, isolated dispatch
credentials, scratch FM_HOME in spawn-batch and teardown cases, wider load
bounds in two timing-sensitive cases.

Carried until upstream: kunchenguid#5684 (issue kunchenguid#1242) covers the
bearings fixture; the rest has no upstream PR yet.

Sources: #108, #122, #139 and rebuild 53d6a4f.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tests/fm-bearings-snapshot.test.sh: BSD sed 'a\' drops the trailing newline, corrupting the fixture backlog and aborting the suite at 28/42 on macOS

2 participants