Skip to content

G6: grant gate for effectful workflow tasks (#59) - #65

Draft
aien-spark wants to merge 2 commits into
lane-g/g5-progress-mappingfrom
lane-g/g6-grant-gate
Draft

aien-spark wants to merge 2 commits into
lane-g/g5-progress-mappingfrom
lane-g/g6-grant-gate

Conversation

@aien-spark

Copy link
Copy Markdown
Collaborator

Closes #59

Lane G, issue G6: an effectful task starts only under a real, bound approval from the Spark desk. Stacked on #64 (G5), base lane-g/g5-progress-mapping.

Tested commit: 4808265 (content 142ff4c). Gates ran against aien-protocols main 4b76f7f.

What is here

  • src/orchestration/grant_gate.rs: GrantDesk trait, GrantBinding (objective id, cause id, grant id), check, EffectBody (prepare, then apply), GrantGate (a TaskRunner: check, prepare, check again, apply), named GrantRefusals.
  • tests/workflow_grant_gate_tests.rs: 11 tests with a fake desk, including the four frozen refusals and a run through the workflow executor.
  • docs/WORKFLOW-DAG.md: one section on the gate.

Decisions (made here, with reasons)

  • No grant gives ApprovalPending (the task waits for a human), not a failure. This matches G3, where a task needing a grant rebuilds as WaitingForApproval. Every other refusal is a Rejected, no-effect failure whose message starts with the refusal name; an unreachable desk is Unavailable, no effect.
  • The grant is bound to both the objective id and the cause id (DoD 1). A binding with either empty is refused (GRANT_GATE_UNBOUND) so empty never matches empty.
  • The gate checks and never spends. Spending is the effect ledger's job when it opens the effect intent, so one authority owns that fact (docs/DELEGATED-DAG.md, proposed D3: the durable, objective-bound compose ledger grant, not the in-memory MCP ApprovalDesk).
  • The desk record carries status, objective id and cause id only. Binding to the request digest is item 3 and is left out rather than guessed.

Checks

Check Result
DoD 1: no effect without a grant bound to objective id and cause id PASS (g6_no_grant_waits_for_approval_and_runs_nothing, g6_foreign_cause_grant_is_refused, g6_unbound_binding_is_refused_even_if_the_desk_matches, negative control g6_bound_available_grant_runs_the_effect_once)
DoD 2: stale, foreign objective, forged refused with names PASS (g6_stale_grant_is_refused for spent, expired, revoked; g6_foreign_objective_grant_is_refused; g6_forged_grant_id_is_refused; g6_refusal_names)
DoD 2: checked again right before the effect PASS (g6_grant_revoked_during_prepare_stops_the_effect)
Through the workflow PASS (g6_gate_inside_a_workflow: no grant gives WaitingForApproval with the dependent Pending; forged gives Failed with the dependent Skipped; zero effects)
DoD 3: tool request is the INTERPLANE canonical request the grant names NOT_RUN: needs aien-protocols-mv#33 (C6)
DoD 4: real sovereign-core desk adapter NOT_RUN: needs aien-sovereign-core-mv#379 (durable grants and a reachable desk)
Red before green PASS: against a stub, 11 of 11 tests failed
Deliberate break A (no re-check before the effect) Red: g6_grant_revoked_during_prepare_stops_the_effect FAILED
Deliberate break B (objective not compared) Red: g6_foreign_objective_grant_is_refused FAILED
fmt, check, clippy -D warnings, test (199 passed), anti-slop, zero-disk-secrets PASS on host
crumb compile then crumb verify . PASS (OK: 13 crumbs current)
Spark bundle with AEGIS-TEST and AEGIS-CLIPPY PASS NOT_RUN: no Spark commands from this lane. The physical Pi/Spark run is lane H (aien-architecture-mv#232)

Remaining gap

Items 3 and 4; the action digest that a waiting_for_approval message (G5) needs comes from the same desk.

Next dependency

aien-sovereign-core-mv#379 (durable grants, desk reachable), aien-protocols-mv#33 (INTERPLANE canonical request), then lane H.

🤖 Generated with Claude Code

drakestapleton and others added 2 commits October 16, 2026 14:58
Wrapper around an effectful task body: check the desk grant against the
request's objective id and cause id, prepare, check again, then apply.
No grant waits for approval; unbound, forged, stale, foreign objective,
foreign cause and desk-unreachable are named no-effect refusals. The gate
never spends the grant. Fake desk only; no sovereign-core client.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

Copy link
Copy Markdown

⚖️ Sovereign Code Review & Alignment Gate

Greetings @aien-spark. I am AIEN, the automated review gate for the AIENOS project.

Your pull request #65 ("G6: grant gate for effectful workflow tasks (#59)") has undergone automated auditing against the project standards.

✅ Doctrine Diff Audit: PASS

  • Telemetry Check: Clean (zero tracking or surveillance hooks detected).
  • Sovereign Voice & Formatting Check: Clean (zero em/en dashes, zero banned buzzwords).
  • Secrets & Credentials Check: Clean (zero plaintext secrets, hardware vault only).
  • Status: Project standards verified.

🌿 Sovereign Steward: Contributor Alignment Interview

Greetings @aien-spark. I am AIEN, the automated steward for the AIENOS project.

We welcome all contributors who share our commitment to open collaboration, global humanity, and disciplined systems craftsmanship. We build to expand computing capability, advance open-source intelligence, and share technology freely with the world.

Your pull request #65 ("G6: grant gate for effectful workflow tasks (#59)") is ready for stewardship alignment.

Please respond directly to these four alignment inquiries:

  1. Long-Term Mission Alignment:
    This initiative is an enduring engineering commitment to open-source technology for humanity, not a vehicle for short-term hype, social media monetization, or get-rich-quick ventures. How does your contribution support global progress and the resilience of local communities?

  2. Telemetry & Integrity:
    Do you certify that this change introduces zero telemetry, zero surveillance, and zero artificial paywalls?

    "I certify that my contribution is submitted in service of human sovereignty and open collaboration. I affirm that this work maintains zero telemetry, contains no surveillance backdoors, and introduces no artificial barriers, and that I offer it under AGPL-3.0-or-later, the license that governs this project. I build so that intelligence is owned by the person who runs it, not rented."

  3. Downstream Heritage Preservation:
    Do you acknowledge and agree that any downstream branch, fork, or copy of this work remains under AGPL-3.0-or-later and retains the project's license and attribution notices, as the LICENSE file requires?

  4. Craftsmanship & Native Discipline:
    What architectural trade-offs did you make, and how did you verify that this code introduces zero regressions, zero unneeded dependencies, and complies with our pure native compiled standards?


Reply to this comment with your affirmation. Once verified against the project standards, I will grant the sovereign-interview-passed clearance. For direct sovereign coordination: Drake Stapleton ([email protected]) and AIEN ([email protected])

@github-actions github-actions Bot added needs-testimony Awaiting contributor oath testimony sovereign-audit-passed Diff clean: zero telemetry and unslop verified labels Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-testimony Awaiting contributor oath testimony sovereign-audit-passed Diff clean: zero telemetry and unslop verified

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants