Skip to content

feat(automations): bind operations to active runs - #182

Draft
yaacovcorcos wants to merge 28 commits into
mainfrom
feature/scient-automation-operation-authority-a1
Draft

feat(automations): bind operations to active runs#182
yaacovcorcos wants to merge 28 commits into
mainfrom
feature/scient-automation-operation-authority-a1

Conversation

@yaacovcorcos

Copy link
Copy Markdown
Contributor

User effect

Automation-triggered provider turns can exercise only the Scient capabilities granted to that exact active run, project, thread, message, turn, provider, runtime epoch, and lease. Stale, terminal, cancelled, interrupted, reconfigured, or provenance-ambiguous runs fail closed. Ordinary user turns keep their existing provider fallback only when the host positively proves no active automation owns the turn.

Why this lane

This is the narrow authority seam required before automations may safely invoke Scient operations. It is independently mergeable after the operation-authority/executor/receipt chain and changes no appearance, layout, motion, responsive behavior, or appearance-dependent accessibility.

Provenance and disposition

  • Disposition: Scient-native reimplementation of the reviewed Synara automation/gateway authority concept.
  • Concept lineage includes Synara 407981969cd90736a313b8263ee37741c7449cba (agent gateway) and 8ea6da0a0715c69f7b744fd4c8b38d698ab7687e (automation lifecycle/recovery).
  • No donor source code was copied and no new dependency was added. The repository root LICENSE retains the Synara MIT notice.

Exact base and head

File impact

17 files, 2,031 additions, 43 deletions.

  • Contracts add immutable automation dispatch provenance and the versioned operation-grant snapshot.
  • Automation service mints the grant only for the run it owns and keeps provenance across terminal states.
  • Gateway/transport resolve active-run authority first and permit user fallback only after positive absence proof.
  • Projection preserves the first non-null dispatch origin so later events cannot downgrade it.
  • Focused tests cover normal admission, stale state, terminal/cancelled/interrupted state, null/forged/overwritten provenance, provider fallback, runtime epoch changes, policy changes, recovery, and the race where automation becomes active after ingress.

Protected boundaries

  • No identity, credential, updater, release, packaging, telemetry, publication, or live-user-data authority was added.
  • No new migration.
  • One-shot scheduler bookkeeping is excluded from the policy hash; real permission/configuration changes invalidate the grant.
  • Legacy null grants are interrupted during recovery rather than guessed.

Verification

Exact head 6d5530f8a19b001d0e3f0e6cfd8156bf20ded926:

  • Focused authority/gateway/automation tests: 70/70 final core set; broader reviewer sets 98/98 and 201/201.
  • bun run typecheck: 9/9 packages; bun run fmt:check; bun run lint: 0 errors; bun run brand:check; git diff --check; clean worktree.
  • bun run build: 5/5 tasks.
  • bun run test: 12/12 tasks in 2m36s; CLI 2,840 passed, 10 skipped. A prior full run had one unrelated telemetry batch-count flake; its focused retry and this clean full rerun passed.

Three independent reviews

  1. Correctness/reliability/concurrency/lifecycle: certified exact head, no P0-P2; 70/70 focused tests.
  2. Security/privacy/credentials/sessions/permissions/release safety: certified exact head, no P0-P2; 98/98 focused tests and typecheck.
  3. Architecture/maintainability/identity/lineage/test sufficiency: certified exact head, no P0-P2; 201/201 focused tests.

P3 limitation: operation grants are bounded to one hour, so a future genuinely longer unlimited automation must renew authority rather than reuse an old grant.

Rollback and limitations

Rollback is a revert of the five commits in this PR; there is no schema migration or destructive recovery. Reverting restores the prior gateway fallback behavior. The feature remains dependent on drafts #172, #178, and #179 and is not integrated until that chain is reviewed and merged.

Validation boundary

No computer use, browser automation, screenshots, geometry checks, visual tests, visual regression, or manual UI acceptance were performed. Hosted CI is allowed to run after publication; this PR remains draft and CI is not being treated as visual acceptance.

Reimplement Synara's gateway durability concept on Scient-owned authority, orchestration, and persistence seams. Persist exact pre-dispatch intent, actor-pseudonymized attempt and terminal receipts, stable semantic replay, conservative restart reconciliation, truthful replay-release audit, and owner-fenced recovery without exposing a new integration endpoint.
Reimplement the Synara automation-authority concept on Scient's central operation executor. No donor code was copied; no additional license notice is required.
@github-actions github-actions Bot added size:XL vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Jul 31, 2026
@yaacovcorcos

Copy link
Copy Markdown
Contributor Author

Final alignment evidence: normally merged updated #179 with no conflicts; exact head c092d8c. Focused server checks 201/201, automation contracts 13/13, typechecks and diff check passed. Hosted exact-head CI is fully green. Combined stack final-head review is in progress.

Base automatically changed from feature/scient-operation-receipts-f2-final to main August 1, 2026 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant