Skip to content

feat: compose independent harness context sources - #1875

Merged
JAORMX merged 13 commits into
mainfrom
impl/harness-context
Sep 25, 2026
Merged

JAORMX merged 13 commits into
mainfrom
impl/harness-context

Conversation

@JAORMX

@JAORMX JAORMX commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Stage and approval boundary

Implementation PR targeting main, under the approved plan amendment #1878 and original plan #1814. Both plan PRs are merged. The implementation has been rebased onto main containing the plan amendment and contextual guardrails (#1510).

The directing human authorized the bug fixes, lightweight rebases, and PR updates. Implementation approval and merge remain separate; this PR has not been merged.

Implementation

  • Independently selected instruction, command, rule, skill, and agent-definition sources with preserved provenance, project admission, precedence, freshness, and child restrictions.
  • Exact SessionID/owner/profile binding. Only selected, admitted principal-scoped registrations with fixed project provenance and UsesExecutionWorkspace receive lazy, exact-authorized read-only workspace acquisition. No runner or execution read-ledger evidence is supplied.
  • Acquisition before root/scheduled-fire publication, exact placement reattachment after restart, attempt-owned cleanup, and retry without closing another caller's placement.
  • Generation references retain sources through child use and in-flight reads. Explicit authorized Load can reactivate a retired binding; ordinary run/discovery cannot.
  • No-FS execution retains independent logical context; a required execution-file source fails without a fabricated fallback.

Fixes from the merge-risk review

The implementation includes three fixes and maintained regressions:

  1. Default configuration now supplies fresh children with the parent's admitted startup instructions, without requiring an explicit harness_context block or selecting child execution files.
  2. Process sources stay alive while first bindings are being created and while unpublished attempt cleanup drains. Final cleanup remains exactly once.
  3. Both lazy command binders check cancellation inside the publication mutex, discard cancelled attempts, and allow a fresh retry without replacing actual binder errors.

internal/app/harness_context_regression_test.go drives real Build/Service Subagent, direct-write, Parallel, Team, no-FS, and untrusted-source cases, including conflicting execution content and rejected child writes. It also covers concurrent creation/shutdown, blocked attempt cleanup, immediate cancellation cleanup, same-holder retry, and principal/process deferred fallback. Internal utility roles remain excluded from harness instructions.

Independent Spec, Standards, Test adequacy, security, architecture, reuse, duplication, and UX review of the fixes completed; actionable findings were addressed and re-reviewed. No public API or plan amendment was introduced by these fixes.

PANEL: ship_blockers=0 important=0 advisory=0 reviewer_failures=0

Verification and rebase scope

Before rebasing, focused race tests (including repeated runs), task test, task test:race, task lint, task docs, task site:build, task api:check, the 25-AC harness-context trace, and the offline demo passed. The demo exercised Read, permission ask/approval, Write result, Team, and background Subagent. Targeted mutation checks failed as intended and were restored.

The combined documentation/API/global-trace command exhausted its time budget during the global trace; no completed global task ac-trace-strict result is claimed. Subsequent verification was interrupted by the directing human's request to perform a lightweight rebase and rely on CI.

After the plan merge: rebased only the implementation commits onto main, without replaying the squashed plan. Resolved internal/app/build.go and internal/app/catalog.go conflicts by retaining both contextual-guardrail state/worker posture and harness-context retirement/inheritance. Checked diff integrity and range-diff preservation.

Focused post-rebase tests passed: TestDefaultHarnessInstructionsFlowToChildren, TestInternalPurposeChildRolesExcludeOperatorProfile, and TestContextualWorkerReviewDetailUsesLiveRootOwnership. No full verification rerun was performed, as requested. CI must verify the current PR head; pre-rebase results are not post-rebase proof.

Local evidence remains under .scratch/pr1875-bugfixes/ in .scratch/worktrees/impl-harness-context-20260923; these logs are not uploaded artifacts. No paid live tests were run by this change.

Excluded scope

No inventory RPC migration, history transfer, recovery recipes, SessionAccess, new storage fencing, or generic child-binding framework. Existing SessionLease/resume contracts remain unchanged. No MicroVM, native Kubernetes, or Redis backend implementation is claimed here. #580, #1579, #1614, and sibling #1811 retain their own integration work; this PR does not close them.

Base automatically changed from plan/harness-context to main September 24, 2026 12:28
@JAORMX
JAORMX marked this pull request as ready for review September 24, 2026 12:32
@JAORMX
JAORMX force-pushed the impl/harness-context branch from c733495 to 5979dd2 Compare September 25, 2026 06:00
@JAORMX
JAORMX changed the base branch from main to plan/harness-context-consumers September 25, 2026 06:00
@JAORMX
JAORMX force-pushed the impl/harness-context branch from 5979dd2 to 1512453 Compare September 25, 2026 07:08
@JAORMX JAORMX added the e2e-live Run the live e2e suite on this PR label Sep 25, 2026
@JAORMX
JAORMX force-pushed the plan/harness-context-consumers branch from 09d2881 to 04254b4 Compare September 25, 2026 08:45
@JAORMX
JAORMX force-pushed the impl/harness-context branch from 1512453 to 71e91e8 Compare September 25, 2026 08:45
Base automatically changed from plan/harness-context-consumers to main September 25, 2026 09:12
JAORMX and others added 13 commits September 25, 2026 12:17
Preserve the verified shared source-composition implementation before rebasing onto the refreshed model and interface contract. Independent review is still required before publication.

Co-Authored-By: OpenAI <[email protected]>
Thread server-owned read-only source acquisition through session factories and discovery, retain source-owned releases, and restrict judge context suppression to internal roles. Include focused regression proofs and composition documentation for local independent review.

Co-Authored-By: Mecatl <[email protected]>
Prove child factory retention, exact scheduled and restart acquisition, failed attempt isolation, and registration selection at real service boundaries.

Co-Authored-By: Mecatl <[email protected]>
Bind default child instructions to the admitted startup source, retain process sources through pending creation cleanup, and discard cancelled lazy binding attempts. Cover child families, trust restrictions, concurrent shutdown, and same-holder retries.

Co-Authored-By: Mecatl <[email protected]>
Preserve the new admission-submission inventory on main, give harness context distinct row IDs, and align its decision reference.

Co-Authored-By: Mecatl <[email protected]>
@JAORMX
JAORMX force-pushed the impl/harness-context branch from 71e91e8 to 6998b8b Compare September 25, 2026 09:18
@JAORMX
JAORMX merged commit 30a4c3c into main Sep 25, 2026
37 checks passed
@JAORMX
JAORMX deleted the impl/harness-context branch September 25, 2026 09:36
@toolhive-release-app toolhive-release-app Bot mentioned this pull request Sep 25, 2026
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

e2e-live Run the live e2e suite on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant