Skip to content

docs(architecture): define ready research contract - #327

Merged
proerror77 merged 1 commit into
mainfrom
codex/prd-315-architecture-contract
Jul 24, 2026
Merged

proerror77 merged 1 commit into
mainfrom
codex/prd-315-architecture-contract

Conversation

@proerror77

@proerror77 proerror77 commented Jul 24, 2026

Copy link
Copy Markdown
Owner

Change contract

Record the binding BTC x 5m continuously-ready research identity, admission, task-authority, ownership, and counterexample contract in the shared prediction-market decision record.

Out of scope

Collectors, catalog storage, snapshot or Mission implementation, research logic, CI, deployment, cloud/runtime mutation, data backfill, old-artifact compatibility, Paper, Shadow, Live, promotion, and profitability.

Dependency or merge order

None.

Focused validation

  • git diff --check origin/main...HEAD
  • npx --yes markdownlint-cli@0.45.0 docs/architecture/PREDICTION_MARKETS.md --disable MD013 (MD013 disabled for the existing table-heavy document convention)
  • Local policy link target resolves.
  • Focused acceptance-term check covers all seven Issue Record the continuously-ready Polymarket research architecture contract #315 criteria and five required counterexamples.
  • Matt Standards review: pass, zero findings.
  • Matt Spec review: pass, zero findings.
  • TDD is not applicable because this issue changes only a decision record and adds no executable behavior or parser.

Rollout/rollback impact

No runtime rollout or authority change. Roll back by reverting this documentation commit; no artifact or data migration is required.

Closes #315

Summary by CodeRabbit

  • Documentation
    • Expanded Prediction Markets research guidance with clearer identity, classification, and verification requirements.
    • Added completeness rules for related episodes and defined required evidence across the research workflow.
    • Clarified task labels for settlement probability and UP/DOWN execution tracks.
    • Added authority profiles and decision criteria for rejecting invalid, incomplete, or leaked research inputs.
    • Clarified that the continuously ready catalog currently supports BTC five-minute episodes; SOL and other durations require separate verified contracts.

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: cca79bac-6220-4fdf-95de-8d3a78cbf6f2

📥 Commits

Reviewing files that changed from the base of the PR and between a4834f6 and 5847d98.

📒 Files selected for processing (1)
  • docs/architecture/PREDICTION_MARKETS.md

📝 Walkthrough

Walkthrough

The prediction markets architecture document formalizes a verifier-driven, continuously-ready research contract and clarifies identity, evidence, authority, rejection, and completeness rules. The governed baseline is limited to verified BTC five-minute episodes, with other horizons and SOL requiring separate contracts.

Changes

Prediction markets research contract

Layer / File(s) Summary
Continuously-ready contract definition
docs/architecture/PREDICTION_MARKETS.md
Defines product, episode, and UP/DOWN instrument identity; verifier-controlled ready, partial, and rejected states; immutable identity pinning; typed settlement and execution evidence; research-only authority profiles; and binding rejection cases.
Governed baseline scope
docs/architecture/PREDICTION_MARKETS.md
Limits the continuously-ready mission path to BTC five-minute episodes, keeps SOL outside that path pending a separate verified contract, and reserves longer horizons and full order-book update ticks for separate research lanes.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related issues

Possibly related PRs

  • proerror77/monday#133 — Implements verified artifact bindings that operationalize the documented contract and token identity rules.
  • proerror77/monday#136 — Aggregates verified Polymarket evidence with BTC/SOL five-minute coverage and identity validation.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/prd-315-architecture-contract

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@proerror77
proerror77 merged commit 7533e5c into main Jul 24, 2026
16 of 17 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5847d988fb

ℹ️ 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".

Comment on lines +107 to +111
| Cohort manifest | Ordered ready-catalog entry digests, event-disjoint partition assignment, common-time boundary, label-availability cutoff, and causal projection rules. |
| `ResearchSnapshot` | Cohort-manifest digest plus the digests of the exact evaluator-visible bytes. It is materialized and cached before Mission admission. |
| Mission | Mission SHA over product family, typed task, run mode, authority profile, cohort partition, snapshot digest, task horizon where applicable, and all evaluator/search parameters. Raw collector paths are forbidden. |
| Runtime image | Exact repository revision, release-binary digest, and immutable OCI image digest selected by the admitted Mission. A mutable tag is not an identity. |
| Result receipt | Mission SHA, snapshot digest, image digest, lifecycle timestamps, and content digest of a create-once result bundle independently rehashed after publication. |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Split the research stages into separate issue contracts

This single issue-level decision record combines cohort/snapshot construction, Mission/evaluator execution, runtime-image admission, and result publication into one binding contract. These stages have independent acceptance and rollback boundaries, and the repository specifically requires them to remain separate Polymarket issues; closing #315 with all of them bundled allows one approval to be treated as authority for unrelated downstream work. Split the stage-specific contracts into separate issues and leave only their shared boundary or cross-references here.

AGENTS.md reference: AGENTS.md:L39-L42

Useful? React with 👍 / 👎.

Comment on lines +109 to +110
| Mission | Mission SHA over product family, typed task, run mode, authority profile, cohort partition, snapshot digest, task horizon where applicable, and all evaluator/search parameters. Raw collector paths are forbidden. |
| Runtime image | Exact repository revision, release-binary digest, and immutable OCI image digest selected by the admitted Mission. A mutable tag is not an identity. |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Bind the runtime image into the Mission SHA

The Mission SHA field list omits the repository revision, release-binary digest, and OCI image digest even though the next row says that the admitted Mission selects that exact runtime image. Consequently, the same admitted Mission identity can be executed or retried with different code while downstream records still treat it as the same Mission; recording the image only in the result receipt is too late to make admission or execution reproducible. Include the immutable image identity in the Mission SHA, or introduce an admitted execution identity that binds the Mission and image before creating the Job.

Useful? React with 👍 / 👎.

| Typed task | Allowed label | Required evidence |
| --- | --- | --- |
| `settlement_probability` | One official binary episode outcome: `UP` or `DOWN`. | Exact market contract, causal Chainlink opening/expiry observations, official resolved outcome and availability clock, plus event-disjoint Brier score, log loss, calibration, and settlement-PnL evidence. Token markouts and fills are not settlement labels. |
| `up_execution` | UP-token fill outcome, realized execution price/slippage, or executable markout at an explicit 5, 10, 15, or 30 second horizon. | Only the bound UP token's point-in-time book/trades, request and sequence evidence, fees, latency, and declared fill/queue assumptions. Official settlement is not an execution label. |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Require ground truth for realized execution labels

When an execution task chooses realized fill price or slippage rather than a simulated markout, the listed evidence contains only public books/trades and declared fill or queue assumptions; it does not require an immutable order, intent, queue position, or fill record from which a realized label can be verified. Such an episode can therefore be classified ready and evaluated against an assumed value presented as realized execution. Require order/fill provenance tied to the decision for realized targets, or explicitly define these targets as simulated and bind the simulation model and assumptions into the task identity.

Useful? React with 👍 / 👎.

Comment on lines +138 to +140
- One named runtime controller may submit, replace, delete, deploy, or otherwise
mutate catalog and cloud runtime resources. All other agents and operators are
read-only until an explicit handoff.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep catalog classification mutations verifier-only

Granting the runtime controller authority to replace, delete, or otherwise mutate catalog resources conflicts with the earlier guarantees that only the independent verifier may append classifications and that rejected or partial receipts remain immutable. If this authority includes catalog entries, a controller can remove or replace admission evidence without a new verification receipt, invalidating cohort digest availability and the audit trail. Restrict the controller to catalog-service infrastructure while explicitly reserving classification-entry writes to the verifier.

Useful? React with 👍 / 👎.

Comment on lines +106 to +107
| Verifier receipt / ready catalog entry | Producer manifest digest; verifier binary, configuration, and policy digests; classification and reason codes; exact product, episode, UP token, DOWN token, supported-task, and coverage identities. |
| Cohort manifest | Ordered ready-catalog entry digests, event-disjoint partition assignment, common-time boundary, label-availability cutoff, and causal projection rules. |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Gate cohorts on an accepted verifier policy

A catalog entry records the verifier-policy digest, but cohort construction only pins entry digests and does not require their policies to be currently accepted. Because classifications are immutable, an episode marked ready by an older policy remains selectable even after a policy update closes a completeness or provenance gap, allowing a new Mission to pass admission with stale readiness semantics. Require the cohort or Mission admission policy to pin and enforce an allowed verifier-policy set, or require a new verification receipt under the selected policy.

Useful? React with 👍 / 👎.

| Run mode | Authority |
| --- | --- |
| `pipeline_smoke` | May prove producer-to-result schema compatibility, admission, cache use, evaluator start, publication, and digest readback with a minimal complete cohort. It cannot emit an alpha, generalization, promotion, or profitability verdict. |
| `research_trial` | May run the typed evaluator and shared MCTS kernel only on event-disjoint train/validation/held-out cohorts. Held-out labels, metrics, and feedback cannot alter candidate search, fitting, selection, or stopping. It may publish research evidence, not activation authority. |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Define a temporal boundary for the held-out cohort

The trial now has separate train, validation, and held-out cohorts, but the contract pins only one common-time boundary and the subsequent boundary definition separates only training from validation. Event-disjointness alone still permits a validation event used for search or stopping to occur after an earlier held-out event, leaking future regime information while satisfying the stated checks. Bind an ordered validation-to-held-out boundary as well, or explicitly define and validate the complete temporal ordering of all three partitions.

Useful? React with 👍 / 👎.

@proerror77
proerror77 deleted the codex/prd-315-architecture-contract branch July 24, 2026 08:44
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.

Record the continuously-ready Polymarket research architecture contract

1 participant