Skip to content

docs(adr): define multi-target execution, recovery and Pi tools - #9261

Closed
eshulman2 wants to merge 2 commits into
fullsend-ai:mainfrom
eshulman2:docs/cve-multi-target-adrs
Closed

eshulman2 wants to merge 2 commits into
fullsend-ai:mainfrom
eshulman2:docs/cve-multi-target-adrs

Conversation

@eshulman2

Copy link
Copy Markdown
Contributor

Summary

Branch-specific assessment workers need to survive host loss and publish investigation work after an inconclusive or failed check. Today a Pi extension can load while its declared native tool is dropped by strict tool translation, and existing poll/concurrency state does not reserve an operation across dispatch, execution and publication.

This design-only PR records three focused decisions needed by that consumer: repository-owned operation journals (ADR 0165), exact selection of vetted Pi extension tools (ADR 0166), and authorized multi-target execution plans (ADR 0167). Each ADR records one decision. Implementation remains separate.

Related Issue

Replaces #9252 with a new PR whose diff contains all three ADRs, including ADR 0167 and the linked architecture updates.

Implementation follow-ups: #9253 (operation journal and recovery), #9254 (exact native Pi extension tools), and #9260 (authorized multi-target execution).

Follows the existing plugin boundary in ADR 0094, per-subject serialization in ADR 0106 and shared poll state in ADR 0132. Related work: #8225 / #8226 / #8228 for runtime-workflow packaging and launch; #9179 for MCP tool selection and child permission intersection. This PR does not replace those changes.

Changes

  • Freeze and authorize a complete multi-target execution plan; isolate each child, use target-aware scheduling/concurrency keys, enforce finite execution bounds and collect every required target independently of domain success. Superseding a plan invalidates stale work without resetting consumed bounds.
  • Choose repository-scoped conditional state updates, attempt ownership generations and separate scheduling, worker and publication receipts; short-lived reconcilers reuse existing schedulers.
  • Preserve pending work across ambiguous scheduler acknowledgements and reconcile external writes before retrying; an empty eventually consistent search cannot prove a create failed.
  • Require exact native Pi tool selection without granting sibling tools, default tools, shell access or publication authority; missing names fail before inference.
  • Add a problem document with alternatives and fault-test acceptance, and update the architecture and related living documents. No ADR already accepted on main is rewritten; the unmerged ADR 0165 now references ADR 0167 for dispatch and collection semantics.
  • Keep CVE/package mapping, Jira payloads and assessment semantics in adapters. A branch investigation ticket after worker failure is not an affected verdict, coding authorization or proof of remediation.

The recovery contract covers GitHub, GitLab and Forgejo, with each backend disabled until it demonstrates conformance. Jira issue properties cannot substitute for conditional journal updates. Native Pi tool selection is forge-neutral.

Current-behavior evidence

Inspected baseline: 96e0c43384dfbd1d57b80711ff75a3b74b753156.

  • piToolsFor: translates the known built-ins and drops otherwise unsupported exact tool names.
  • PiRuntime.Bootstrap: uploads vetted harness Pi extensions separately from tool translation.
  • fullsend-hooks.js: already preserves an extension's native name when no built-in hook mapping exists.
  • jirapoll.Run: documents the downstream scheduling-acknowledgement gap on the shell dispatch path; the output-driver path still allows duplicate accepted dispatches after partial failure.
  • poll/state.go: existing signed CAS poll state is credited as precedent, not treated as an operation reservation or publication journal.
  • internal/cli/run.go: validation and post-script handling belong to one invocation; this decision adds cross-invocation receipts rather than claiming those hooks are absent.

Additional dispatch evidence at baseline 7455751ecb9446953527dbf73b4e379ea5442cb0:

Testing

  • Staged make lint passes, including ADR status/number/frontmatter checks, offline Markdown links, secret scanning and the pinned Semgrep scan.
  • git diff --check passes.
  • Documentation only: no runtime, scheduler, API or forge behavior changes, and no live worker or Jira acceptance is claimed.

Checklist

  • PR title follows Conventional Commits.
  • Human-directed commit has DCO sign-off.
  • I wrote this contribution myself and can explain all changes in it.

Prepared with coding-agent assistance; the contributor can assess the personal-authorship attestation above.

Signed-off-by: eshulman2 <ellashulman1@gmail.com>
Signed-off-by: eshulman2 <ellashulman1@gmail.com>
@eshulman2
eshulman2 requested a review from a team as a code owner November 10, 2026 09:21
@github-actions

Copy link
Copy Markdown

E2E tests did not run

E2E tests run automatically for pull requests authored by users with write access or higher.

For other contributors, someone with write access must add the ok-to-test label after the latest push.

Reason: unauthorized

See E2E testing guide for details.

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can move or hide resolved findings to focus on what still needs action

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Document recoverable multi-target execution and strict Pi tool access

📝 Documentation 🕐 40+ Minutes

Grey Divider

AI Description

• Define authorized multi-target plans with isolated workers, bounded execution, and complete result
 accounting.
• Specify repository-owned journals for cross-host recovery and ambiguous publication
 reconciliation.
• Require exact vetted Pi tool selection and document implementation acceptance criteria.
Diagram

graph TD
  A["Domain adapter"] --> B["Authorized plan"] --> C[("Operation journal")] --> D["Existing scheduler"] --> E["Isolated workers"] --> F["Result collection"] --> G["Publication adapter"]
  H["Vetted Pi tools"] --> E
  C --> G
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Integration-owned recovery stores
  • ➕ Let each integration tailor its persistence and recovery behavior.
  • ➖ Duplicate authorization and reconciliation controls across integrations.
  • ➖ Allow recovery guarantees to diverge.
2. Central durable workflow service
  • ➕ Provide managed timers, retries, and worker ownership.
  • ➖ Introduce an operated dependency and new trust boundary.
  • ➖ Still require reconciliation of ambiguous external writes and authorization changes.

Recommendation: Keep the proposed host-admitted plans, repository-owned journals, and exact Pi tool selection. They preserve the existing repository authority model without a coordinator service or broader runtime permissions. Conditional-write, backend-conformance, and ambiguous-write fault tests should remain enablement gates.

Files changed (10) +443 / -1

Documentation (10) +443 / -1
0165-recover-work-through-repository-owned-operation-journals.mdDecide repository-owned recovery journals +102/-0

Decide repository-owned recovery journals

• Defines conditional journal updates, attempt ownership, and separate scheduling, worker, and publication receipts. Requires reconciliation of ambiguous writes and backend conformance before enablement.

docs/ADRs/0165-recover-work-through-repository-owned-operation-journals.md

0166-select-pi-extension-tools-without-widening-access.mdDecide exact Pi extension tool selection +74/-0

Decide exact Pi extension tool selection

• Requires declared native tool names to resolve against vetted extensions before inference, including explicit empty tool sets. Rules out fallback access to sibling, default, or broader tools and preserves child permission limits.

docs/ADRs/0166-select-pi-extension-tools-without-widening-access.md

0167-execute-authorized-multi-target-plans.mdDecide authorized multi-target execution plans +105/-0

Decide authorized multi-target execution plans

• Defines immutable, bounded plans with per-target authorization, isolated execution, and result binding. Distinguishes complete result accounting from assessment success and specifies how superseding plans invalidate stale work.

docs/ADRs/0167-execute-authorized-multi-target-plans.md

architecture.mdIntegrate the three decisions into the architecture overview +17/-1

Integrate the three decisions into the architecture overview

• Records Pi tool selection, multi-target plans, and operation journals as decided but unimplemented. Clarifies that journal selection does not settle adapter implementation or external-system guarantees.

docs/architecture.md

agent-architecture.mdConnect agent coordination to recovery and tool permissions +12/-0

Connect agent coordination to recovery and tool permissions

• Links repository-based coordination to the journal and target-plan decisions without adding a coordinator agent. Points to the exact Pi tool permission decision.

docs/problems/agent-architecture.md

agent-infrastructure.mdRelate worker infrastructure to durable ownership +8/-0

Relate worker infrastructure to durable ownership

• Explains that restarting workers requires reconciliation of ownership and external effects. Links the journal and bounded target-execution decisions while noting implementation remains open.

docs/problems/agent-infrastructure.md

cross-run-memory.mdSeparate mechanical recovery from cross-run learning +5/-0

Separate mechanical recovery from cross-run learning

• Clarifies that journaled attempts and work bounds address immediate recovery, not whether a different model strategy should be tried.

docs/problems/cross-run-memory.md

durable-work-recovery.mdDocument recovery failures, alternatives, and acceptance tests +109/-0

Document recovery failures, alternatives, and acceptance tests

• Describes lost acknowledgements, competing hosts, stale workers, missing children, and plan changes. Compares recovery approaches and sets fault-test expectations for journals and multi-target plans.

docs/problems/durable-work-recovery.md

operational-observability.mdDistinguish recovery receipts from run traces +5/-0

Distinguish recovery receipts from run traces

• Explains why traces alone cannot resolve ambiguous external writes and points operators to separate scheduling, execution, and publication receipts.

docs/problems/operational-observability.md

security-threat-model.mdDocument least-privilege Pi tool selection +6/-0

Document least-privilege Pi tool selection

• States that selecting one vetted extension tool must not expose sibling tools or runtime defaults. Links that requirement to the Pi tool-selection ADR.

docs/problems/security-threat-model.md

@eshulman2

Copy link
Copy Markdown
Contributor Author

Split into three independently reviewable PRs, each based on main and containing one ADR plus its related document updates: #9264 (recovery), #9265 (Pi tool selection), and #9266 (multi-target execution). Closing this combined PR in favor of those replacements.

@eshulman2 eshulman2 closed this Nov 10, 2026
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