Skip to content

Add the pre-registered leverage schedule v1 (G-e, SYN, opt-in; ladder statuses unchanged) - #91

Merged
seathatflowsinourveins merged 6 commits into
mainfrom
claude/leverage-policy-20260922
Sep 23, 2026
Merged

seathatflowsinourveins merged 6 commits into
mainfrom
claude/leverage-policy-20260922

Conversation

@seathatflowsinourveins

Copy link
Copy Markdown
Owner

Summary

  • G-e leverage policy leverage-schedule-v1-20260922 (SYN, opt-in), implementing the user's decision record (agent-lab docs/decisions/2026-09-22-leverage-schedule-and-entitlement.md).
    • A fixed ceiling keyed by session × regime × drawdown ladder:
      • ≤ 4x intraday, ≤ 2x overnight (Reg T);
      • 0 in risk_off/unavailable and on the kill switch;
      • clamped by the broker account multiplier and by config max_leverage ≤ 4.
    • No optimiser, no learned leverage.
  • Enforcement points: the policy entry budget, plus a ledger backstop that counts pending buys and positions awaiting sale (the Codex P1 fix).
  • Opt-in only:
    • Shipped config.json and config-sip.json carry no leverage_policy; behaviour and the golden fixture are byte-identical.
    • A non-canonical policy block is refused.
    • recover (sell-only) is not blocked by the margin check.
  • Rung configs config-leverage-{1x,2x,4x}.json: each scales per-order sizing and loss caps.
    • Every leveraged run records peak achieved gross-to-equity leverage, the ceiling in force at that moment, and seconds spent above the next-lower rung.
    • A rung establishes the envelope at its cap. Achieved exposure may stay below the cap, and the README says so.
  • New module leverage.py is pinned in source-hashes.json. The ladder gate notes are updated; statuses are unchanged because no paper rung has run.

Review

  • Workflow wf_15a285a3-93b: Opus design → Sonnet build → three review lenses (risk invariants, default path, evidence honesty) → fix/verify.
  • Workflow wf_a84807f8-593: F2 reachability fix → three-lens final review.
  • One read-only Codex cross-family review (companion 1.0.6, gpt-6-astra, effort high, read-only sandbox): found P1 (blocker) and P2 (major). Every finding was verified resolved.
  • Coordinator fix: AchievedLeverageReceiptIntegrationTests was timing-dependent and failed deterministically on this host. It now forces the trend regime for complete, non-risk_off samples, because the class covers the receipt, not regime classification. 5/5 passes.

Evidence

  • python3 -m unittest: 2330 OK (335 skipped). Engine interpreter: 2330 OK (14 skipped).
  • All validate.yml steps and trading_gates.py --check rc=0.
  • Guarded gitleaks ran before each commit: no leaks.

🤖 Generated with Claude Code

leverage-schedule-v1-20260922 per the user's decision record: a fixed
ceiling keyed by session x regime x drawdown ladder, <= 4x intraday and
<= 2x overnight, 0 in risk_off/unavailable and on the kill switch, clamped
by the broker account multiplier and config max_leverage <= 4, enforced at
the policy entry budget and as a ledger backstop that counts pending buys.
Opt-in only: the shipped configs carry no leverage_policy and behave
byte-identically (golden fixture unchanged). Rung configs 1x/2x/4x scale
per-order sizing and loss caps; each run records the achieved peak
gross-to-equity leverage and time above the next-lower rung (a rung
establishes the envelope at its cap, not a target exposure). Reviewed by
three Claude lenses and one read-only Codex cross-family review
(gpt-6-astra, high); all findings verified resolved.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…gate notes

Resolves the source-hashes conflict by regenerating from disk, makes the
achieved-leverage integration tests deterministic (trend for complete
non-risk_off samples; they cover the receipt, not regime classification),
and records the SYN leverage receipt block and the ladder gate notes.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…y-20260922

# Conflicts:
#	docs/ecosystem/index.html
#	manifests/evidence.json
…y-20260922

# Conflicts:
#	manifests/evidence.json
…y-20260922

# Conflicts:
#	docs/ecosystem/index.html
#	manifests/evidence.json
…y-20260922

# Conflicts:
#	docs/ecosystem/index.html
#	manifests/evidence.json
@seathatflowsinourveins
seathatflowsinourveins merged commit 168a3a8 into main Sep 23, 2026
6 checks passed
seathatflowsinourveins added a commit that referenced this pull request Sep 23, 2026
…rted (#96)

* Stop committing the generated public explorer; keep evidence manifest sorted

docs/ecosystem/index.html (12+ MB, rewritten on every doc change) caused
repeated main-branch merge conflicts and made every PR's gitleaks history
scan report ~2,322 pre-existing SHA-like strings, avoided only via a
--max-target-megabytes 2 coverage hole. GitHub Pages is not enabled, so no
live site depended on the committed file. It is now generated locally with
`python3 scripts/build_ecosystem.py --write`, gitignored, and published as
its own attested release artifact by publish-catalog.yml.
scripts/build_ecosystem.py --check no longer compares against a committed
file; it builds twice into temporary directories, asserts byte-identical
output, and reports input/output digests. Every reader-facing reference to
the file was updated to say how to get it now; dated historical records that
quote its past committed state were left untouched.

manifests/evidence.json's files[] now stays sorted by path for
conflict-friendly parallel inserts: a new scripts/evidence_manifest.py
--write|--check normalizer/checker, a matching scripts/validate.py rule, and
scripts/host_receipts.py's register_file() now inserting at the sorted
bisect position instead of always appending.

See docs/decisions/2026-09-23-generated-explorer-sorted-manifest.md for the
full evidence, alternatives (sharded manifests; release-tag-only commits;
GitHub merge queue -- rejected, this repository is a personal-account User,
not an organization) and overturn conditions.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Fix round: rebase onto main, scan the built explorer, fix stale docs and artifact-retention wording

Fix round on the generated-explorer-sorted-manifest branch, resolving four
findings from an independent review:

1. The branch was one commit behind origin/main (base a10de9f; main is now
   168a3a8, #91), and #91 touched both files this branch rewrites
   (docs/ecosystem/index.html, manifests/evidence.json). Rebased onto
   168a3a8: the index.html modify/delete conflict resolved to the deletion,
   and evidence.json resolved to #91's current entries (including its 5 new
   leverage entries) minus the removed index.html entry, then rehashed with
   tools/rehash_evidence.py and re-sorted with
   scripts/evidence_manifest.py --write. The decision record's base-commit
   note now reflects 168a3a8.

2. The published explorer never went through the private-content scan:
   validate.py's scan_publication() only walks git-tracked/listed paths, so
   a freshly built, gitignored artifact was invisible to it. Added
   scripts/validate.py --scan-file PATH, a standalone mode running the same
   PRIVATE_CONTENT patterns directly against a file's bytes, and wired
   publish-catalog.yml to run it on the built explorer immediately before
   attesting it.

3. docs/ecosystem/README.md still described the old committed-file model
   (dead index.html link, "download the file from GitHub", stale --check
   semantics). Rewrote it to match the generate-locally-or-download-the-
   artifact model. tests/test_adoption_contract.py asserted every
   adoption/manifest.json sources[] entry is a committed file, which would
   now fail on a clean checkout for the generated ecosystem_explorer entry;
   it now explicitly skips that one key (pinning its expected value so the
   exclusion cannot hide a different broken reference).

4. Every reader-facing reference calling the workflow artifact a "release
   artifact" overstated its persistence: it is a 7-day-retention artifact
   from workflow_dispatch/v*-tag runs only, with no GitHub Release. Reworded
   every occurrence to name the actual retention and trigger scope, and
   added an overturn condition for when that limitation stops being
   acceptable.

Regression tests: tests/test_validate.py (scan_file_for_private_content unit
tests and --scan-file CLI tests), tests/test_adoption_contract.py (pins the
ecosystem_explorer exclusion to its exact expected path).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Run the second determinism build in a separate interpreter with a different hash seed; refresh the record's digests

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Publish only the explorer bytes --check verified; include the template in the input digest

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: seathatflowsinourveins <234074349+seathatflowsinourveins@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@seathatflowsinourveins
seathatflowsinourveins deleted the claude/leverage-policy-20260922 branch September 25, 2026 18:47
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