feat(process): open-region slot — applies_to invariant scoping + open_region marker#425
Merged
Merged
Conversation
Sibling to ADR-022/023. Records the engine strategy for COR-040: region-scoped invariants are an `applies_to` filter on evaluate_invariants keyed on the resolved position; boundary-enforcement is exit-gate predicate composition (no invariant→move-blocking); a shut exit is a closed gate, not a blocked overlay; and the compound "(predicate) AND (cross-authority artifact)" exit is NOT one gate — the sign-off stays an authorisation-artifact gate, the conjunction lives in the wrapper (ADR-023 primitive), because folding it into a deterministic predicate loses the COR-033-P4 authorship guarantee. Authored by the architect agent; supersedes nothing. Tracked by #418. Status: proposed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Approved by Aleš Kalfas (authorised the architect→software-engineer chain); architect gave clean clearance (advisory, no escalation). Unblocks the engine + shape implementation on #418. Status: accepted. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…_region marker Implements COR-040 / ADR-036: an invariant may carry an optional `applies_to` state scope, and a state may be marked `open_region: true`. Both additive — existing processes declare neither and validate byte-unchanged. Engine (evaluate_invariants) filters each invariant by `applies_to` against resolve_position().state_id: unscoped stays process-wide (COR-035 unchanged); scoped is evaluated/surfaced only when the subject's resolved position is the region; scoped under another region or an indeterminate position is not-applicable (not evaluated, not surfaced). Fail-closed on an indeterminate scoped check is unchanged. The filter reuses the existing PredicateRunner + cache and reads position once. No new gate kind, no new blocked reason, no invariant→move-blocking primitive — precheck_transitions, evaluate_gate, and evaluate_blocked are byte-unchanged; the region exit is an ordinary deterministic / authorisation-artifact gate. Status/validate surface the filtered set through the existing "Invariant violations" + "Legal moves" surfaces (narrative + --json), so a region-scoped violation renders alongside the shut exit gate as the reason the subject cannot leave. Shape reference (process README) flips the open-region and applies_to / boundary-enforcement rows from deferred to core. No migration owed (pure additive; check-diff reports no trigger). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Surface change (PRJ-002): new shape fields (invariant.applies_to, state.open_region) + engine behaviour + a new convention adopters follow. Broadens the adapter's requires_backbone ceiling. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Owner
Author
|
Reviewer agent (local, reviewer): APPROVED Reviewed PR #425 ( Findings
Note (non-blocking): the ADR-036 commit body shows status authored as |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #418.
What
Ships the open-region slot's shape contract + engine (Feature #416 under EPIC #237), implementing accepted COR-040 per accepted engine-strategy ADR-036. The whole engine novelty is a position-keyed filter in
evaluate_invariants: an invariant may carry an optionalapplies_to(a state id); scoped invariants evaluate/surface only when the subject's resolved position matches, unscoped stay process-wide (COR-035 unchanged). Astate.open_regionmarker is declared in the shape (inert to the engine — no new node kind). Boundary-enforcement is exit-gate predicate composition (no invariant→move-blocking); a shut exit is an ordinary closed gate.Additive only — existing processes validate byte-unchanged; no migration owed. Includes the
minorversion bump 1.133.0 → 1.134.0.Doc impact
.pkit/process/README.md(shape reference) updated:open_region+applies_toadded to the state / invariant skeletons; the open-region and per-state-scoping / boundary-enforcement rows flipped from deferred to core, describing enforcement as gate composition (report-only preserved). No other doc surface affected.Test plan
New
tests/test_process_open_region_engine.py+tests/test_process_open_region_schema.pycover: unscoped-unchanged (in/out of region), scoped-in-region evaluated, scoped-out-of-region not-surfaced, scoped-under-indeterminate not-applicable, status/validate filtering (narrative +--json), violated-region-invariant-alongside-shut-exit rendering, exit opening when met, read-only. Full suite: 4227 pass.pkit migrations check-diffclean;schemas/decisions validatepass.Reviews
critic+architect.architect; the implementation matched it verbatim (no adjustments).Scope
Task #418 (engine + shape + ADR) under Feature #416. Next: #419 grounds the slot on trip-planning
build(DEC-014 → accepted).🤖 Generated with Claude Code