Skip to content

Sync Boatstack from Intelligence Flow Labs @ d4c1a8ecc53f - #114

Closed
operator-stack-publisher[bot] wants to merge 1 commit into
mainfrom
sync/intelligence-flow-d4c1a8ecc53f
Closed

Sync Boatstack from Intelligence Flow Labs @ d4c1a8ecc53f#114
operator-stack-publisher[bot] wants to merge 1 commit into
mainfrom
sync/intelligence-flow-d4c1a8ecc53f

Conversation

@operator-stack-publisher

Copy link
Copy Markdown
Contributor

What this sync releases

recovery-status no longer blocks on an unrelated, already-ignored stale delivery

recovery-status scans the shared delivery-state store before it selects the delivery a correction belongs to. That scan (allManagedDeliveryStates) failed closed on the first unreadable delivery and never consulted workflow.ignored_deliveries. So a single delivery abandoned by an earlier session — malformed on disk, and already explicitly ignored — turned every recovery into a repo-wide BLOCKED: Managed delivery state cannot be verified, even when the delivery actually being recovered was healthy and on the current branch. An operator hit exactly this in the field: recovery of a fine, unrelated pull request was stranded by a stale ignored delivery it had no relationship to, with no in-tool way forward.

This is the same failure class the next boundary already closed under the control law stale-delivery-cannot-block-unrelated-feature — but that law had been written as if it lived only at the ResolveNext boundary, so the twin read-only boundary, ResolveRecovery, never got the treatment. The store is one shared resource crossed by three boundaries: the two read-only resolvers (ResolveNext, ResolveRecovery), which must tolerate an unrelated corrupt delivery, and the mutation enumerator (ActiveManagedDeliveries), which must stay fail-closed so corrupt state can never be laundered into a write.

The law is now stated over the invariant rather than one call site, and ResolveRecovery enforces it. allManagedDeliveryStates partitions the store the way scanManagedDeliveries does for next: readable states come back as data, unreadable slugs come back as a separate list rather than aborting the scan. ResolveRecovery then applies the operator's ignored-deliveries filter to both lists before any invalidity becomes fatal, and blocks only on a delivery that is still both invalid and unignored — naming it and routing to the discard-delivery remedy. Recovery of an unrelated healthy delivery proceeds with an ignored corrupt delivery in the store; the mutation boundary is unchanged and still fails closed.

The regression suite pins the class shut at the recovery boundary with the twins of the existing next conformance tests — an ignored invalid delivery no longer blocks a healthy branch (positive/bypass), a still-unignored invalid delivery blocks while naming the offender and prescribing discard-delivery (negative/relation), and the read-only resolver leaves the offending state byte-for-byte untouched. A companion guide, docs/control-law-scoping.md, records the method that would have caught the original miss: state a control law over its invariant and failure class, enumerate every boundary that crosses the shared resource, and extend the existing law to cover them rather than minting a near-duplicate for the second one.

Concurrent first use no longer fails with "Text file busy" on Linux

When several tool calls hit an empty shared-runtime slot at the same time, one guard
hydrates the slot and the others wait. On Linux the kernel refuses to run a file while
another process still holds it open for writing. It reports this as "Text file busy". A
waiting guard could reach the run step in that brief window, fail to start the helper, and
deny the tool call by mistake. This showed up as a flaky Linux CI failure under contention.
macOS and Windows do not enforce this rule, so only Linux saw the denial.

The guard now retries the helper a bounded number of times when the start fails with this
exact condition, then hands off as before. The retry is short and self-clearing: the peer
closes the file the moment its write finishes, so the next attempt starts the helper. A
helper that genuinely cannot run still returns the same status after the retries, so no real
failure is hidden. The runtime binary is still written atomically, so the fix only closes
the read-side race.

Projection provenance

Generated from operatorstack/intelligence-flow@d4c1a8ecc53f1bf82d3974f533b02eb0b9f93221.
Review provenance, tests, and examples before merging.

@bigboateng

Copy link
Copy Markdown
Contributor

Superseded and closing. This auto-generated sync snapshot predates the double-checked-locking hydration fix (intelligence-flow #198), so its test (ubuntu-latest) fails on TestGuardAutoHydrationSerializesConcurrentFirstUse ("hydrator ran 2 times under contention, want exactly 1"). That fix is on main, and boatstack main is already synced past this commit (now @ 70614614df37, #120), which passes ubuntu cleanly. Nothing here is unmerged — this snapshot is obsolete.

@bigboateng bigboateng closed this Jul 26, 2026
bigboateng added a commit that referenced this pull request Jul 26, 2026
auto-merge-sync merges a passing sync PR but never closed the older sync PRs it
superseded. A sync PR that fails CI is never merged by this job, so once a newer
sync overtakes it, it lingers as an orphan (this is what left #109/#113/#114 open
and failing until they were closed by hand).

After the merge, check out the public intelligence-flow repo for history and close
every open sync/intelligence-flow-* PR whose source commit is an ancestor of the
just-merged source (already included), skipping the merged branch itself and
leaving newer, not-yet-merged syncs untouched. Reuses the primitives already in the
pipeline: gh pr list --json, git merge-base --is-ancestor, the sync branch prefix,
and UPSTREAM.json's source.commit.

Co-authored-by: bigboateng <bigboateng@users.noreply.github.com>
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.

1 participant