docs(research): plan candidate decimal admission fix (RP22)

This commit is contained in:
Boki 2026-10-27 21:00:48 -04:00
parent 86013538a1
commit b51612e57f
4 changed files with 61 additions and 8 deletions

View file

@ -8,7 +8,7 @@
[manifest.json](manifest.json) owns scheduling metadata: status, priorities, dependencies, ADR approvals, assignments and write locks. Task Markdown owns implementation scope/evidence/acceptance. This index and the [graph](dependencies.mmd) are derived views. Only the planning/integration owner updates scheduling state.
**Current total: 97 retained IDs — 85 done, 1 in progress, 7 deferred, 4 merged.** RP18 completes the bounded October multi-session pilot; RP01–RP17 add the authorized real-data workflow and its dataset reuse, export and workflow recovery follow-ups. The earlier 68 IDs retain their state. E11 adds seven authorized cleanup tasks and one conditional replay extraction; see the manifest for current scheduling. The original backlog accounted for 55 IDs. F09/P07 added projection/profiling work; the owner deferred P08's TypeScript optimization. Merged records preserve traceability; never execute them separately. Deferred work requires its stated trigger and explicit activation.
**Current total: 98 retained IDs — 85 done, 1 in progress, 1 blocked, 7 deferred, 4 merged.** RP18 completes the bounded October multi-session pilot; RP01–RP17 add the authorized real-data workflow and its dataset reuse, export and workflow recovery follow-ups. The earlier 68 IDs retain their state. E11 adds seven authorized cleanup tasks and one conditional replay extraction; see the manifest for current scheduling. The original backlog accounted for 55 IDs. F09/P07 added projection/profiling work; the owner deferred P08's TypeScript optimization. Merged records preserve traceability; never execute them separately. Deferred work requires its stated trigger and explicit activation.
States: ready, claimed, in_progress, review, done, blocked, deferred, merged. “Ready” means no code/ADR prerequisite, not execution authority. Implementation dependencies require accepted integration. `release_gates` govern enabling an end-to-end feature, not component coding or integration; conditional gates apply only to the named capability. F05 may integrate before F06, but its replay behavior is not released until F06 proves it.
@ -193,4 +193,6 @@ Owner authorized planning and per-task implementation commits. [Execution plan a
- [RP20: Production research authentication](tasks/RP20.md) — done, `7de497e9`; normal API startup uses the existing research resolver, with actual issued-credential and quota regressions.
- [RP21: Bounded volatility-filter study](tasks/RP21.md) — in progress; two fixed isolated mean-reversion configurations, retrospective September holdouts and at most ten trials. Reuses existing candidate code.
- [RP21: Bounded volatility-filter study](tasks/RP21.md) — blocked by RP22; inputs reviewed, original first-admission receipt retained with zero runs; two fixed isolated mean-reversion configurations, retrospective September holdouts and at most ten trials. Reuses existing candidate code.
- [RP22: Candidate decimal admission](tasks/RP22.md) — in progress; preserve known-program decimal normalization without changing original research input.

View file

@ -325,3 +325,7 @@ flowchart TD
RP03 --> RP21
R08 --> RP21
R09 --> RP21
A02 --> RP22
RP17 --> RP22
RP22 --> RP21

View file

@ -1,8 +1,8 @@
{
"schema_version": 1,
"plan_revision": "2026-10-27.115",
"plan_revision": "2026-10-27.116",
"repository_base": "b7aeca4",
"plan_status": "bounded_signal_study_in_progress",
"plan_status": "candidate_decimal_admission_fix",
"execution_authorized": true,
"execution_scope": {
"authorized_by": "Owner: commit and continue with the rest of the tasks till 100%",
@ -3659,14 +3659,15 @@
"epic": "E12",
"priority": "P2",
"severity": "Medium",
"status": "in_progress",
"status": "blocked",
"dependencies": [
"RP20",
"A02",
"A03",
"RP03",
"R08",
"R09"
"R09",
"RP22"
],
"decision_dependencies": [],
"task_file": "backlog/tasks/RP21.md",
@ -3675,8 +3676,8 @@
"write_locks": [
"aapl-september-signal-study"
],
"blocker": null,
"integration_state": "preflight",
"blocker": "SQL32 compares raw minNotionalVolume string with normalized known-program request. First training admission rolled back; zero runs/experiments. Preserve exact receipt.",
"integration_state": "inputs_reviewed_admission_recovery_pending",
"completion_evidence": "real-data-research.md",
"release_gates": [],
"review_status": "pending",
@ -3684,6 +3685,32 @@
"authorization": "Owner continuation follows bounded AI signal-study recommendation. At most ten isolated research trials on fixed September partitions. No fabricated human review, paper/live activation or deferred optimization.",
"scope_notes": "Reuse unchanged bundled mean-reversion code in existing isolated-candidate mode; two fixed configurations differ only by volatility filter. No candidate source rewrite. Availability inventory only; no September prices/returns or results inspected. See task for frozen parameters, policy, windows, limits and evidence requirements.",
"integration_base": "2949680b"
},
{
"id": "RP22",
"title": "Preserve candidate decimal normalization during SQL admission",
"epic": "E12",
"priority": "P1",
"severity": "High",
"status": "in_progress",
"dependencies": [
"A02",
"RP17"
],
"decision_dependencies": [],
"task_file": "backlog/tasks/RP22.md",
"complexity": "S",
"assignment": "/root/audit_recovery_next",
"write_locks": [
"candidate-parameter-sql-admission"
],
"blocker": null,
"integration_state": "planned",
"review_status": "pending",
"completed_commit": null,
"completion_evidence": "real-data-research.md",
"release_gates": [],
"authorization": "Necessary regression fix discovered during authorized RP21 execution; preserve frozen strategy/financial policy and exact failed receipt."
}
],
"review_note": "Independent skeptical revision: four superseded tasks retain stable IDs; deferred work is not a dependency of scheduled tasks. Release gates are distinct from implementation prerequisites.",

View file

@ -0,0 +1,20 @@
# RP22 — Preserve candidate decimal normalization during SQL admission
Parent E12. P1 / High research admission defect. Complexity S. Dependencies A02 and RP17. Discovered while executing the owner's authorized RP21 continuation. Root owns planning/integration and study recovery; one backend implementer owns an additive SQL migration, startup registration and PostgreSQL regression tests. Independent review required. Do not modify previous migrations or frozen research inputs.
Verified evidence: RP21's original filtered training request contains `minNotionalVolume: "0"`. `validateStrategyParameters()` in `apps/stock/config/src/contracts/strategy.ts` applies the known mean-reversion schema, producing `"0.00000000"`. `database/postgres/init/32-candidate-parameter-defaults.sql` expands defaults but compares raw parameter strings literally, so `validate_experiment_manifest` rejects the prepared request. Actual PostgreSQL logged its complete-identity guard error; exact-receipt inspection confirmed zero experiments/runs. The existing AI workflow fixture uses already-normalized parameters and misses this case. Frozen evidence is under `.data/research-pilots/aapl-202409-signals/`.
Scope: forward migration33, registered in `apps/stock/web-api/src/migrations/migration-runner.ts`, that preserves original input/preview hashes and performs the same existing normalization for the known mean-reversion financial-string parameter when comparing to the frozen request. Prefer a local SQL expression/variable inside the existing validator over a new general parameter framework. Preserve all other admission, ownership, approval, risk, dataset and immutable-receipt guards. Arbitrary candidate string parameters must retain exact string semantics. No TypeScript strategy, calculation, native engine or financial policy change.
The known parser accepts plain signed decimal strings with at most eight fractional digits and the fixed-eight financial range; it canonicalizes negative zero, while the strategy rejects negative nonzero notional. Verify actual grammar/range in `libs/core/types/src/financial-engine.ts` and the built-in strategy schema. SQL must not introduce rounding, exponent/leading-zero/plus spellings or loose numeric coercion. Match the exact trusted program identity, not an arbitrary property name.
Acceptance/tests:
- Disposable PostgreSQL reproduces the current failure through real candidate preview/admission using raw `"0"`, then the forward migration makes the exact same body/key/hash succeed and replay to the same IDs. No copied normalized input substituted for the original.
- Valid plain spellings, a fractional value, negative zero and already-canonical values retain their input bytes while requests normalize correctly. Default expansion and omitted optional parameters continue to work.
- Direct SQL guard mutations reject changed economic values, malformed or excessive-precision/out-of-range decimals, wrong parameter types, missing/extra parameters, and unrelated candidate normalization. Existing failure-oriented ownership/grant and admission tests stay green.
- Reapplying the migration leaves historical rows/results, IDs and active receipts unchanged. Existing known-program authorization checks remain intact.
- Affected disposable PostgreSQL suites, migration-runner tests, application/authored-test types, scoped lint/format and relevant repository gates pass. Preserve installed engine/worker/sandbox bytes for RP21; no builds while study identities are frozen. Record any unavailable/skipped gate accurately.
- After review/commit, apply through the normal migration runner's lock/transaction. Reopen the study's original receipt state, retry only the exact idempotent stopped request and continue from saved acknowledged resources. Never restart the entire cycle, recreate its hypothesis/family/version, alter risk/parameters, or exceed ten trials.
Exclusions: general SQL parameter engine, signal changes, migration history rewrites, deleting/replacing research artifacts, new candidate/version IDs for recovery, paper/live activation, performance work. Regression risk is weakened direct SQL validation or string coercion in arbitrary strategy schemas. Compare independently with the actual TypeScript parser; retain the original failed receipt as evidence.