Skip to content

docs(verify): keep resting orders across a restart and cover the safe exit refusals - #526

Merged
MarcosACH merged 2 commits into
mainfrom
docs/verify-map-upkeep
Oct 17, 2026
Merged

MarcosACH merged 2 commits into
mainfrom
docs/verify-map-upkeep

Conversation

@MarcosACH

Copy link
Copy Markdown
Owner

The round trip recipe read FAIL on main. It still expected paper to ghost a resting order after a restart. Since #500, paper rebuilds its book from the store, so the order stays live. The engine is right and the map was stale.

What changed

  • paper-round-trip and ghost-reconcile now prove the order stays live after a restart, on replay and on the wall clock. A real ghost is no longer reachable from the helper, and the file says so.
  • config-refusals adds the store lock and the reserved __operator__ id.
  • safe-exit adds a paper section: cancel-all is refused while the engine runs, and flatten works with no key.
  • crash-recovery and postgres-store check seq_records.
  • hyperliquid-testnet adds the 10 second wait its gotcha asked for, and notes that live margin reads null until the venue posts it.
  • Small fixes: the strategy count and the store table list in SKILL.md.

Proof

Every feature was driven live on main @ 496ca90. Every changed recipe was re-driven as written and reads PASS (rt-m2 8/8, ghost-m2 2/2, ghostlive-m 3/3, refuse-m2 8/8, se-paper-m 6/6, testnet-m 10/10, crash-m 9/9, pg-m 7/7). No product code changed.

Closes #525

🤖 Generated with Claude Code

… exit refusals

Since #500, paper rebuilds its book from the store at boot. The round trip and ghost recipes
still expected the resting order to be ghosted, so the round trip read FAIL on main. Both now
prove the order stays live. A real ghost is unreachable from the helper, and the file says so.

The map also gains the store lock and reserved id refusals, a paper flatten, the seq_records
checks, and the 10 second wait the testnet recipe was missing. Every changed recipe was re-driven
live and reads PASS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 17, 2026 15:13
@MarcosACH MarcosACH added ai Created or executed by an AI agent ralph:needs-review PR opened, awaiting code-review labels Oct 17, 2026
@MarcosACH MarcosACH self-assigned this Oct 17, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@MarcosACH MarcosACH left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review of docs/verify-map-upkeep @ d5f59fa

Reviewer: code-review skill
Reviewed: 2026-10-17
Optimization axis: correctness (the recipes must match what the engine does)

Mechanical

  • ruff format: pass
  • ruff check: pass
  • mypy: pass
  • lint-imports: pass (7 kept, 0 broken)
  • pytest: pass (2185 passed, 75 skipped, coverage gate met)

No product code changed, so the mechanical pass only confirms the tree is still green.

I checked the recipe claims against the code. These all hold:

  • _resting_orders in app/build.py keeps only LIVE or partly filled GTC limits with a price.
  • dump prints five tables (STORE_TABLES in verify.py).
  • run_strategy.py registers five strategies. REST_BELOW defaults to 0.8 and WAIT_SECONDS to 0.
  • StoreLockHeld refuses an engine with exit 1, and an exit run with exit.refused and reason="lock_held" (engine/runner.py:279).
  • The __operator__ message matches domain/position.py:61.
  • ADR-0052, ADR-0054, and ADR-0059 say what the recipes cite them for.
  • #500, #517, #519, and #524 are all merged on main.

Findings

[WARN] R001 — .claude/skills/verify-tickwright/features/safe-exit.md:32 — Paper section hides behind testnet preconditions

Category: docs
Why: The preconditions need a funded testnet key and list only run id se-paper's sibling safe-exit. An operator with no key stops there and never runs the paper part. That is the one part of this file that runs on the hermetic path. The paper steps also start after the testnet Cleanup, so a top-to-bottom reader thinks the recipe ended.
Fix: Add a precondition line: "The paper section needs no key. Run id se-paper is unused." Also add a short lead-in at line 75 that says the paper section runs on its own, with or without the testnet part.
Status: open

[NIT] R002 — .claude/skills/verify-tickwright/features/ghost-reconcile.md:17 — Reason string is asserted in a different test file

Category: docs
Why: tests/engine/test_reconcile.py proves the window and the reject, but it never asserts the reason. The string reconciliation: ghost: vanished from the venue is asserted in tests/engine/test_execution_manager.py:1460.
Fix: Cite test_execution_manager.py for the reason. Optionally cite tests/engine/test_reconcile_runtime_e2e.py:179 for the window on the composed engine.
Status: open

[NIT] R003 — .claude/skills/verify-tickwright/features/ghost-reconcile.md:4 — One new sentence is over 25 words

Category: docs
Why: "It arms a 90 second grace window, the open-order cadence re-reads ..." is about 27 words. CLAUDE.md caps a sentence at 25.
Fix: Split it into two sentences after "window".
Status: open

Summary

  • BLOCKING: 0 open
  • WARN: 1 open
  • NIT: 2 open
  • Merge: BLOCKED

Ralph-State: changes-requested

@MarcosACH MarcosACH added ralph:changes-requested Code-review found BLOCKING/WARN issues; must fix and removed ralph:needs-review PR opened, awaiting code-review labels Oct 17, 2026
@MarcosACH

Copy link
Copy Markdown
Owner Author

Correction to R001 Why: the preconditions list only run id safe-exit. They do not list se-paper. The rest of R001 stands.

The safe exit preconditions asked for a testnet key, so a reader with no key
skipped the paper part. Also cite the test that checks the ghost reason, and
split one long sentence.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MarcosACH

Copy link
Copy Markdown
Owner Author

@MarcosACH MarcosACH added ralph:review-addressed Fixes pushed; awaiting re-review and removed ralph:changes-requested Code-review found BLOCKING/WARN issues; must fix labels Oct 17, 2026

@MarcosACH MarcosACH left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review of docs/verify-map-upkeep @ ba263ec

Reviewer: code-review skill
Reviewed: 2026-10-17
Optimization axis: correctness (the recipes must match what the engine does)

Mechanical

  • ruff format: pass
  • ruff check: pass
  • mypy: pass
  • lint-imports: pass (7 kept, 0 broken)
  • pytest: pass (2185 passed, 75 skipped, coverage gate met)

The fix commit ba263ec touches two Markdown files only.

Findings

[WARN] R001 — .claude/skills/verify-tickwright/features/safe-exit.md:32 — Paper section hides behind testnet preconditions

Status: resolved — ba263ec (verified)
The preconditions now say the paper section needs no key and names run id se-paper. The paper set up step says it runs on its own.

[NIT] R002 — .claude/skills/verify-tickwright/features/ghost-reconcile.md:17 — Reason string is asserted in a different test file

Status: resolved — ba263ec (verified)
The recipe now cites tests/engine/test_execution_manager.py for the reason. That file asserts it at line 1460.

[NIT] R003 — .claude/skills/verify-tickwright/features/ghost-reconcile.md:4 — One new sentence is over 25 words

Status: resolved — ba263ec (verified)
The sentence is split after "window".

No new findings. The recipes cite #484 (the issue) and the PR body cites #500 (its fix). Both are correct.

Summary

  • BLOCKING: 0 open
  • WARN: 0 open
  • NIT: 0 open
  • Merge: READY

Ralph-State: ready

@MarcosACH MarcosACH added ralph:ready Clean review; eligible for merge and removed ralph:review-addressed Fixes pushed; awaiting re-review labels Oct 17, 2026
@MarcosACH
MarcosACH merged commit 65125d1 into main Oct 17, 2026
11 checks passed
@MarcosACH
MarcosACH deleted the docs/verify-map-upkeep branch October 17, 2026 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai Created or executed by an AI agent ralph:ready Clean review; eligible for merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Verify recipes still expect paper to ghost a resting order after a restart

2 participants