Skip to content

PT-C2-AB: add read-only execution eligibility surface for prepared effects#9

Merged
m0r6aN merged 9 commits intomainfrom
claude/suspicious-kirch
Mar 19, 2026
Merged

PT-C2-AB: add read-only execution eligibility surface for prepared effects#9
m0r6aN merged 9 commits intomainfrom
claude/suspicious-kirch

Conversation

@m0r6aN
Copy link
Collaborator

@m0r6aN m0r6aN commented Mar 19, 2026

Summary

Introduces a read-only execution eligibility surface for prepared effects. This adds a derived evaluation layer that determines whether a prepared effect meets all authority conditions for execution, without granting execution capability.

This is strictly observational:

  • No execution authority introduced
  • No mutation paths introduced
  • No changes to existing contracts or governance surfaces

What Changed

Substrate

  • Added ExecutionEligibilityView and reason types (eligibility.dto.ts)
  • Added createExecutionEligibilityRepository().evaluate(preparedEffectId) with EligibilityEvaluationContext
  • Added deterministic query key: collectiveObservabilityQueryKeys.executionEligibility.detail(...)
  • Implemented strict evaluation across:
    • Prepared effect readiness
    • Activation presence/state
    • Permission validity/expiry (with else-if guard to prevent co-firing)
    • Delegation validity/revocation
    • Upstream revocation (derived: delegation revoked + activation exists)
    • Scope narrowing (simulated via mocks)
  • Evaluation returns all failing reasons (no early exit), recomputed on every call, deterministic and side-effect free

Tone Semantics

  • eligible → success
  • not_eligible + hard boundary violation → danger
  • not_eligible + incomplete/missing conditions → warning

Hard failures: scope_mismatch, upstream_revoked, delegation_invalid, delegation_revoked, permission_invalid, permission_expired

UI

  • Added ExecutionEligibilityPanel — read-only panel with tone-mapped borders/icons, zero interactive affordances
  • Added compact eligibility summary to prepared effect stage card
  • Barrel exports for all eligibility modules

UI constraints: no execution affordances, no action buttons, language remains observational

Mocks

5 named fixtures: fully eligible, missing activation, expired permission, revoked delegation, scope mismatch

What Is NOT Included

  • No execution capability
  • No mutation endpoints
  • No real scope model (simulated only)
  • No policy engine expansion

Notes

  • Existing build issues in governance-api.ts and jest types are pre-existing on main
  • This PR introduces no new type errors or regressions
  • Resolved conflict with upstream eligibility panel (PR Add read-only execution eligibility surface #8) — our version adds tone-mapped borders, shield icons, and timestamp footer

Test Plan

  • npx tsc --noEmit — zero errors from eligibility files
  • pnpm build — fails only on pre-existing governance-api.ts errors (verified same on main)
  • UI sanity pass on PR preview

🤖 Generated with Claude Code

m0r6aN and others added 9 commits March 18, 2026 20:09
8-task plan covering DTOs, query keys, mock fixtures,
repository with evaluation context, barrel exports,
UI panel, and stage card integration.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…nown IDs

- resolveEligibilityTone and buildEligibilityPresentation moved from
  eligibility.mocks.ts to eligibility.dto.ts (production code, not mock-only)
- Mock repository now throws for unknown preparedEffectIds, consistent
  with chain.repositories.ts pattern

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Export ExecutionEligibilityPanel from components barrel
- Add mt-1 spacing to eligibility status line in stage card

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@m0r6aN m0r6aN merged commit f7569d2 into main Mar 19, 2026
@m0r6aN m0r6aN deleted the claude/suspicious-kirch branch March 19, 2026 00:12
@m0r6aN m0r6aN restored the claude/suspicious-kirch branch March 19, 2026 00:12
@m0r6aN m0r6aN deleted the claude/suspicious-kirch branch March 19, 2026 00:13
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