You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(journal): per-write mirror for open-task-consumed metadata keys (#1162) (#1168)
* feat(snapshot): per-write mirror substrate constants + canonical-frame predicate
* feat(gate): per-write mirror TaskUpdate leg for open-task targeted keys
* feat(gate): per-write mirror TaskCreate leg
* test(seam): per-write subprocess integration + drain-recovery
* docs(protocols): journal-fallback recovery for drained scope tasks
* docs(hooks): correct stale PreToolUse matcher claim
* test(commands): re-anchor rePACT dispatch-site pin after Phase 0 fallback insertion
* test(seam): adversarial matrix + staleness probe for the per-write mirror
TEST-phase depth for the per-write task_metadata_snapshot path, driven
through the seam (evaluate_lifecycle + the real hook subprocess), with
caps imported from the substrate constants:
- cap-edge payloads (per-value cap/cap+1, whole disk-and-delta overlay
over the payload cap, 5MB jumbo) — bounded journal lines, marker
truncation, key existence preserved
- marker-lookalike values: provenance-not-shape end-to-end, incl. the
hostile non-int original_bytes variant
- hostile task_ids (traversal, control chars, unicode) through the
sanitized claim path — marker containment, sanitized event ids
- pathological shapes: deep nesting intact, serializer-breaking nesting
hermetic with no marker poison, None-riddled deltas, non-dict deltas
(incl. a list carrying a targeted-key token — guard-first shape)
- exit-0 advisory contract: substrate write failure compensates
(unclaim) and preserves advisories; identical advisories across the
fire/skip frame boundary
- leadSessionId staleness probe: stale-mismatch downgrades to skip
(baseline, no marker), stale-equal admit lands in the process's own
resolvable journal; drained config skips without crash
- completing-TaskUpdate disjointness boundary: targeted delta on a
completing write yields exactly the completion event
- real-process rows: unchanged-rewrite dedup across process lifetimes,
stale-config skip, hostile-id containment, oversized stdin frame
* docs(gate): document the intentional team-resolution split at the per-write frame gate
is_canonical_journal_frame resolves its team via the identity-matched
get_team_name() resolver while the per-write emit legs use the persisted
ctx team_name; record at both sites why neither direction may be unified
(topology correctness after resume-divergence vs cross-seam marker-namespace
consistency) and why divergent outcomes stay bounded.
* test(seam): pin teachback_rejection fire-trigger + ruled-key minimum subset
Close the registry's silent-deletion channel with two additive rows:
a teachback_rejection-triggered fire on an open task with an on-disk
teachback_submit sibling asserts the whole-payload overlay mirrors
BOTH (the rejection-cycle catch-up that gives the teammate-written
class its tmux durability; the delta carries only the rejection, so
the row also reds if the key leaves the registry), and a
minimum-subset pin keeps the five ruled keys deletion-protected while
registry extensions stay one-string source diffs.
* chore: bump version to 4.6.3 (PATCH)
* feat(snapshot): target the audit verdict pair in the per-write mirror registry
audit_summary and audit_summary_authored join PER_WRITE_MIRROR_KEYS: both
are consumed by the lead at CODE-phase close while the audited task is
still open, so a status-blind drain destroys them while load-bearing.
Same teammate-written canonical-frame class as teachback_submit.
* test(seam): pin the audit verdict pair in the per-write registry contract
Extend the ruled-key minimum-subset pin to seven keys and add an
audit_summary fire-trigger row: an open-task write of the audit
verdict mirrors the whole overlay immediately. The row uses a lead
frame with no authored-verdict sibling on disk so the gate's
audit_summary_authored preservation machinery stays untangled from
the snapshot-seam assertion; deleting either audit key from the
registry now goes red.
* refactor(claim-gate): re-point _read_lead_session_id to the shared pact_context copy
Delete the inline duplicate; import the SSOT implementation (module-attribute
binding preserves the test patch seam). Relocate the gate-specific stale-config
blast-radius note to the Step-3 call site, and re-orient the LOGIC-PARITY
cross-refs: pact_context is the SSOT, session_registry keeps the one remaining
inline copy forced by its self-contained-leaf invariant.
* test(parity): update drift-guard prose to the SSOT re-point topology
The parity test's docstring still narrated two independent inline
copies; task_claim_gate now binds the shared pact_context
implementation, leaving session_registry as the one inline copy its
leaf invariant forces. Prose only — the behavioral parity contract
and every assertion are unchanged.
Copy file name to clipboardExpand all lines: pact-plugin/commands/rePACT.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -189,6 +189,7 @@ Branch behavior depends on whether rePACT is invoked with a scope contract:
189
189
Before starting, verify:
190
190
1.**Nesting depth**: Read `TaskGet(taskId).metadata.nesting_depth` — if > 1, reject (max depth exceeded). If absent, treat as 0.
191
191
2.**Scope contract**: If this rePACT was dispatched from ATOMIZE, read the scope contract from `TaskGet(taskId).metadata.scope_contract` instead of expecting it inline in the prompt. This ensures scope state survives compaction.
192
+
-**Journal fallback (covers items 1–2)**: If `TaskGet(taskId)` cannot resolve (task store drained), recover from the session journal instead: run `python3 "{plugin_root}/hooks/shared/session_journal.py" read --session-dir "{session_dir}" --type task_metadata_snapshot` (prints a JSON array), filter to events whose `task_id` matches this task, take the latest-`ts` event, and read `nesting_depth` / `scope_contract` from its `metadata` (honor `_truncated` / `_dropped_keys` markers if present).
192
193
3.**Scope appropriateness**: Is this truly a sub-task of the parent?
193
194
4.**Domain determination**: Single-domain or multi-domain?
0 commit comments