Repository navigation
Persist owner standing with revisioned asks and action guards (#629) - #759
Conversation
# Conflicts: # oxa/oxa-work/src/lib.rs
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
No P1–P3 findings. Read the full patch, including the complete standing implementation/tests and changes relative to the independently reviewed facts-storage parent. Checked revision conflicts, owner-only initialization/answers, exact proposal binding, preserved owner-hold protection through supersession, monotone lead budget/gate restrictions, named release against a retained matching merge fact, and callback execution under the current stable guard lock. Policy and facts use a bounded prepared handoff with capacity validation before reservation and durability recovery before effects; active rules/asks are never silently evicted. Tests exercise real callbacks, concurrent child-process locking, unavailable/corrupt policy, pending recovery, negative authority cases and mismatched runtime evidence. The module deliberately leaves runtime adapters/action wiring to their owners; Stored does not claim Applied or merged. The size is substantial but bounded and reuses the existing protected-file/facts machinery. No builds/tests run locally. The orchestrator still needs its own oxa-work/trust-boundary read. |
|
First-pass review by oxa → oxc → TIER: T3 🤖 Generated with Claude Code (oxa review lane) |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4511f9fd89
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| situation::apply(&mut snapshot, &event)?; | ||
| prepare(&event)?; | ||
| state.pending = Some(event_value(&event)?); | ||
| self.root.atomic(STATE, &state.bytes()?)?; |
There was a problem hiding this comment.
Preserve projection capacity for prepared standing mutations
If the process stops after prepare(&event) persists a pending standing ask but before the facts reservation is durable, another facts producer can consume the capacity that was just checked. For example, with 127 active situation rows, preparing an ask succeeds; after restart, a runner fact can occupy row 128 before Standing is reopened. Standing::load_facts then retries the pending ask through facts.append, which fails the 128-row limit. Every standing read, answer and guard now fails at that same recovery step—including answering an existing ask to free space. Ensure unrelated facts cannot consume a prepared mutation's reserved projection capacity, or provide a safe recovery path that does not leave all standing operations blocked.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Confirmed. Committed failing-first regression 92e8fe9 reproduces the exact permanent active situation capacity exceeded failure using an actual facts-directory write failure, 127 active rows and a later producer filling the last slot. The fix now reserves an unpublished fact before preparing policy, then makes it replayable only after policy durability. Other appenders cannot steal that capacity; a standing read can cancel a next-revision reservation only when its durable policy has no pending mutation. All 58 work tests pass, including a real child-process crash after preparation, one-time recovery, and a failed owner-release preparation that preserves the hold. Full workspace/strict/native/resource validation is running; PR remains draft.
There was a problem hiding this comment.
Fixed in b084de5 after committed red 92e8fe9. Current-head full workspace passes 3,882 tests/report with zero runtime skips; all 58 work tests, strict all-target clippy, doctests, fmt, scans and links pass. Native held-action/proposal and policy-fsync-EIO recovery pass again. The real crash test proves the reserved last slot remains unavailable to another producer until the prepared fact is recovered once. The failed-policy test proves an unpublished reservation can be discarded without releasing an existing hold. Ordinary facts keep their old append path. Current resource/TTFB measurements and the added policy-mutation sync cost are documented in the body. Own gate43905459154 is green; PR is ready for a fresh full run and review.
|
No P1–P3 findings. Read the complete resolution delta against ccd4344: standing policy/storage/guard behavior and tests are unchanged. Protocol macro context composes the merged formatting, and the redundant fixture-root modification drops out against the new base. Rechecked that standing checkpoint identity validation remains intact, including reserved source and matching revision. Prior independent checks of authority, revision conflict, durable fact handoff and per-effect locks still apply to identical code. No builds/tests run locally. The orchestrator still needs its own oxa-work/trust-boundary read; no approval is implied. |
|
First-pass review by oxa → oxc → Codex findingsCONFIRMED — P2, TIER: T3 🤖 Generated with Claude Code (oxa review lane) |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0e9cdca17e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const MAX_ACTIVE: usize = 128; | ||
| const HISTORY: usize = 16; | ||
|
|
||
| #[derive(Clone, Debug, Deserialize, Serialize)] |
There was a problem hiding this comment.
Redact private standing data from Debug output
When a caller formats Read with {:?} for an error or diagnostic, the derived implementation recursively emits every entry and ask, including owner said text, answers, Source::Command.command, and session references. These values are explicitly protected standing data and may contain credentials or private owner instructions, so replace the derived implementation with a redacted Debug (and likewise avoid exposing the independently public nested types).
AGENTS.md reference: AGENTS.md:L10-L13
Useful? React with 👍 / 👎.
| pub fn append(&self, checkpoint: Checkpoint, at_ms: u64, fact: Fact) -> Result<Event> { | ||
| self.append_with(checkpoint, at_ms, fact, None::<fn(&Event) -> Result<()>>) | ||
| } |
There was a problem hiding this comment.
Reserve StandingChanged for the prepared append path
When any ordinary producer passes the new public Fact::StandingChanged variant to Facts::append, this path commits the reserved standing source without preparing or updating standing.json. Starting from revision 0, such an append at revision 1 makes every subsequent standing read or guard fail with standing file disagrees with facts revision, with no public recovery path. Reject this variant in append so only the crate-private prepared handoff can publish standing revisions.
Useful? React with 👍 / 👎.
| let before = self.load()?; | ||
| let mut after = before.next(expected, at)?; | ||
| let ask = Ask { | ||
| id: format!("A-{}", after.revision), |
There was a problem hiding this comment.
Namespace standing ask IDs across fact producers
When the shared situation already contains a valid AskOpened from another source with an ID such as A-1, the first standing ask generated at revision 1 reuses that globally keyed ID. situation::open_ask then rejects the standing mutation if the contents differ; if they happen to match, the later standing close removes the unrelated ask because AskClosed also carries only the ID. Include a standing-specific namespace in generated ask IDs so independently valid fact producers cannot collide.
Useful? React with 👍 / 👎.
| if facts.situation()?.standing_revision != 0 { | ||
| return Err("standing facts already exist".into()); | ||
| } |
There was a problem hiding this comment.
Reserve a facts source slot during standing initialization
When the facts store already contains all 16 allowed non-standing sources, this initialization still succeeds because it checks only standing_revision. The first rule, hold, or ask then reaches append_prepared, fails facts source capacity exceeded, and can never succeed because source metadata has no removal path; the same permanent failure occurs if another producer fills the final slot after initialization but before the first standing mutation. Initialization must reserve the standing source capacity, or ordinary producers must be limited to leave that slot available.
Useful? React with 👍 / 👎.
`verify` selected an entry by `state != Superseded` alone. A release is a new entry that supersedes the constraint it releases, so every earlier record carries `state = Superseded`; the call therefore never matched somebody else's rule. But `is_live()` also excludes `Retired` and an inactive constraint in `Stored` state: - `rule(false, supersedes=Some(id))` stores the release in `Stored` state, and a second `rule(_, Owner, Value::Retired, supersedes=Some(id))` stores a retired note the same way; - both were verify-able, so a frontend checker that reports the already released value and scope would move the record to `Applied` and advance the standing revision; - the record is not live, `rule()` can never supersede it again (stale supersession refuses), and `is_held`/`with_guard` ignore it, so "applied" evidence would describe a rule that already released itself. With_guard, remind and answer already filter on liveness. `verify` now uses the same `is_live()` predicate. The test fails before the change. Test: `verify_refuses_released_and_retired_rules` in `oxa/oxa-work/src/standing/store/tests.rs`.
The new verification test asserted that every non-live entry is `Stored`. A release or retirement supersedes the record it releases, so that record is `Superseded` by design; the test failed on the superseded hold rather than on the behaviour it covers. Assert the two refused records (the release and the retirement) directly, and that the refused verification changed no state. Test: `verify_refuses_released_and_retired_rules` in `oxa/oxa-work/src/standing/store/tests.rs`.
|
Five synthetic regressions are pushed at dbce064 before the four new Cloud boundary fixes: protected/nested Debug, ordinary StandingChanged publication, cross-producer ask collision, source-slot reservation race and already-full initialization. Helper727c2820/f7972917 is retained. Returning to draft while these confirmed findings and expected-red controls are repaired; the old conflict-only approval does not certify this new semantic delta. Source writer is codex-lead; no reset/force/rewrite, local test/build, or timer change. |
|
@codex review |
|
@codex security review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a312ba7fdc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if !state.standing_reserved { | ||
| state.standing_reserved = true; | ||
| self.root.atomic(STATE, &state.bytes()?)?; | ||
| } | ||
| Ok(()) |
There was a problem hiding this comment.
Establish durability when reusing a standing reservation
If the first reservation renames facts.json successfully but its directory sync fails, initialization returns an error while standing_reserved remains visibly true. Retrying initialization then skips this block and can succeed without ever establishing the reservation's durability. With 15 existing sources, a subsequent crash can lose that unsynced rename, allowing another facts producer to consume slot 16 before Standing reopens and permanently preventing standing mutations. The new flag fast path therefore needs to sync the existing metadata before acknowledging the reservation, just as the prepared-event retry path calls durable(STATE).
Useful? React with 👍 / 👎.
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
|
@codex review |
|
@codex security review |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
T3 — protected standing rules, holds, asks and owner decisions (#629). Ready for current required CI and Cloud qualification; facts/standing qualification requires both Cloud reviews.
The standing store uses the existing protected file/lock and prepared facts-append APIs. It preserves revision CAS, authority checks, owner text, applied verification, hold/retirement history and bounded active data. It never writes runner task state or launches workers. Public Debug remains available but redacts private owner/command/session payloads, including independently formatted nested types; serialized owner data is retained.
Current candidate a312ba7 reserves a facts source slot during initialization before a competing producer can consume it. Ordinary producers retain all16 slots until standing explicitly initializes. Public Facts::append refuses reserved standing observations/checkpoints and standing-prefixed ask IDs; generated standing asks use their own namespace. This prevents unsynchronized standing revisions and collisions with other fact producers. Existing capacities, budgets, revisions and recovery assertions remain.
Removes: payload-bearing derived Debug implementations (replaced by redacted Debug), public unsynchronized standing-event injection, and unnamespaced generated standing asks. Paging/recovery fixtures now use the protected prepared-append seam rather than bypassing it. The helper's released/retired-rule test changes and both histories are preserved; no branch reset, size split or new feature.
Validation: test-first dbce064 reproduced the Debug boundary failure in hosted lane44130671967. Candidate93ffb228 passed all selected tests except one existing recovery fixture still using public append (lane44148874347). Candidatea312ba7f adapts only that fixture to the protected API while retaining its recovery/no-duplicate assertions; lane44151822193 passed on both architectures. Synthetic data and isolated HOME only, no local builds/tests, real keys or provider calls. Current green CI and both Cloud reviews remain required; this is not landing clearance. The existing397/407/749/776 landing order retains priority.
Ports the standing-asks input to #307 row digest + attn-watch (port plan). Revisioned asks and their close transitions supply the signal for a later wake consumer. The wake service and operational alarms are separate.
Test-first head
651f732b7e09a65075fe9887b4c18daff90e9347reproduced the reservation retry finding in hosted lane 44162690225. The directory sync failed after the rename, the reserved flag was visible, and the old retry unexpectedly acknowledged it. Fix headdf5997e5373acffa1b1cdd3e3554a412deac1f3breusesRoot::durableunder the existing facts lock to sync metadata and its directory before acknowledgment. Hosted lane 44164424166 passed on hosted x86_64 and ARM64. Required checks 44164438776 passed. Current-head Cloud code and security reviews reported no findings.