feat(research): add projects and revisioned evidence-linked findings
This commit is contained in:
parent
618fb9e33c
commit
ee45257507
22 changed files with 2947 additions and 17 deletions
|
|
@ -537,3 +537,19 @@ The initial aggregate check exposed stale pure-contract allowlists and lint issu
|
|||
Deployment requires the existing native research runner (`useRustEngine: true`) and matching immutable build files. Capability is input/artifact validation, not worker health. An incompatible deployment fails an accepted run; historical build restoration belongs to R12. [R05](backlog/tasks/R05.md#first-vertical-slice--2026-10-23) documents the explicit offline v2 import and remaining source-preparation contract. No candidate/multi-asset/default activation, benchmark or performance work, new-wave commit, push or PR.
|
||||
|
||||
**Next after acceptance/commit: R03 research projects, hypotheses and evidence-linked findings APIs.** It is independently ready and adds useful research workflow without pretending full R05 is finished. R05's source-to-v2 preparation and broader cutover remain tracked; R06/S06 dependencies are not released by this partial milestone.
|
||||
|
||||
## Twenty-fourth-wave handoff — 2026-10-23
|
||||
|
||||
The initial R05 slice is accepted and committed as `618fb9e`; full R05 remains **in_progress**. R03 is independently reviewed and `validated_uncommitted`. Eighteen implementation/shared-contract/migration/test files add the research metadata APIs. Persistence and HTTP agents worked in isolated worktrees under `/tmp/stock-bot-wave24.3Qsd1y/`; root owned contracts, evidence resolution, composition and integration.
|
||||
|
||||
- **Research organization:** Projects can organize existing strategies, hypotheses and notes/findings. Project edits and real membership changes advance revision identity. Hypothesis/artifact edits append immutable narratives with explicit authorship; stale edits return 409. Archive/restore preserves prior narratives and cited results, with actor/time recorded.
|
||||
- **Evidence:** Findings cite known scalar paths on exact completed retained runs, optionally binding the retained strategy version. The existing result reader supplies canonical or qualified legacy values; no copied metric truth or simulator was introduced. Null reasons, genuine zeros, units and result limitations are preserved. SQL references protect retained results and prevent later additions to an old revision's evidence set.
|
||||
- **Authorship:** Verified operator/service submitter is separate from declared human/AI/unknown content origin. A service cannot claim human authorship. All prose remains unvalidated; a citation does not certify a conclusion. No AI credential, code execution or review framework was added.
|
||||
- **Correctness fixes during review:** Evidence resolution now uses the active transaction connection, avoiding deadlock when the pool has one connection. Corrupt retained storage produces a sanitized server error with its diagnostic cause, rather than blaming a valid client request. Project membership changes also preserve actor attribution and optimistic revision identity.
|
||||
- **Validation:** `bun run check` passed all gates, including **590 integration** and **150 Rust** tests (4 manual ignored), plus build/source/contracts/secrets/lint, 93 tooling, 43 utility and 44 calculation tests. Full disposable PostgreSQL/Redis: **159 tests / 1279 assertions**. Existing Chromium workflows: **9 / 164 assertions**, including actual retained canonical execution/reopen. Strict changed-test types, scoped formatting/test lint and diff checks passed. No research UI is claimed by these browser regressions; that is R04.
|
||||
|
||||
Exact source hashes, commands and review dispositions are recorded in `manifest.json` → `twenty_fourth_wave_validation`. The release addon matches the previous wave and checkout release library; Rust financial source is unchanged. After the interruption, all 18 implementation hashes were reverified and both disposable containers were confirmed removed. Development/production services and data were untouched; worktrees and logs remain for review.
|
||||
|
||||
R03's [implemented API contract](backlog/tasks/R03.md#implemented-contract--2026-10-23) documents revision inputs, archive/error behavior and evidence limitations. Initial metadata POSTs use ordinary creation semantics, so clients must handle ambiguous responses without blind retries. No R03 commit, push, PR, new simulator, performance work or trading/default activation.
|
||||
|
||||
**Next after acceptance/commit: R04 — research workspace and save-findings UI**, consuming these same APIs. R05's remaining source preparation and wider cutover are still tracked; R06/S06 gates remain intact.
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# Canonical development backlog
|
||||
|
||||
**First twenty-two waves committed; the initial R05 vertical slice is validated and uncommitted.** R02 is accepted as `d929db7`. Reviewed built-ins can now run against one eligible retained v2 dataset through the durable Rust engine and reopen canonical results in the web workbench. Full R05 remains in progress. Performance work remains paused. See [current handoff](../ROADMAP.md#twenty-third-wave-handoff--2026-10-23) and manifest execution scope.
|
||||
**First twenty-three waves committed; R03 is validated and uncommitted.** The initial R05 slice is accepted as `618fb9e`; broader R05 remains in progress. R03 adds research projects, revisioned hypotheses/notes/findings and exact retained metric citations through the shared API. R04 supplies the workspace UI next. Performance work remains paused. See [current handoff](../ROADMAP.md#twenty-fourth-wave-handoff--2026-10-23) and manifest execution scope.
|
||||
|
||||
## One source of truth
|
||||
|
||||
|
|
@ -74,7 +74,7 @@ Relative size: S narrow correction, M coherent boundary, L sensitive owner-contr
|
|||
| --- | --- | --- | --- | --- |
|
||||
| [R01 Persist immutable strategy versions and parameter schemas](tasks/R01.md) | P1 / done | O01, ADR-006 | — | Full-stack research product / M |
|
||||
| [R02 Deliver strategy catalog and version-aware backtest setup](tasks/R02.md) | P1 / done | R01, W03, ADR-006 | W04 | Full-stack research product / M |
|
||||
| [R03 Add projects, hypotheses and evidence-linked findings APIs](tasks/R03.md) | P1 / ready | R01, R10, ADR-006 | — | Full-stack research product / M |
|
||||
| [R03 Add projects, hypotheses and evidence-linked findings APIs](tasks/R03.md) | P1 / review | R01, R10, ADR-006 | — | Full-stack research product / M |
|
||||
| [R04 Deliver research workspace and save-findings flow](tasks/R04.md) | P1 / blocked | R03, W02, ADR-006 | W04 | Full-stack research product / M |
|
||||
| [R05 Freeze complete provenance and cut over durable canonical runs](tasks/R05.md) | P0 / in_progress | F08, S02, R01, R10, D01, W03, C06, ADR-006 | Multi-asset default mark-policy disposition | Full-stack research product / M |
|
||||
| [R06 Create immutable experiments and bounded sweep expansion](tasks/R06.md) | P1 / blocked | R05, ADR-006 | — | Full-stack research product / M |
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
{
|
||||
"schema_version": 1,
|
||||
"plan_revision": "2026-10-23.50",
|
||||
"plan_revision": "2026-10-23.52",
|
||||
"repository_base": "b7aeca4",
|
||||
"plan_status": "twenty_third_wave_partial_validated",
|
||||
"plan_status": "twenty_fourth_wave_validated",
|
||||
"execution_authorized": true,
|
||||
"execution_scope": {
|
||||
"authorized_by": "User: commit and continue after validated R02 handoff; R02 committed d929db707a4894096b8b31ebd25c5e39d15289c1.",
|
||||
"authorized_by": "User: commit and continue after R05 partial handoff naming R03; R05 slice committed 618fb9e33cebc1fde4869eb1f975a12c55bd9b94.",
|
||||
"tasks": [
|
||||
"R05"
|
||||
"R03"
|
||||
],
|
||||
"permissions": [
|
||||
"R05 trusted-built-in single-asset retained-v2 vertical slice, isolated implementation, correctness tests, cross-agent review and planning updates"
|
||||
"R03 research metadata/evidence APIs, isolated implementation, correctness tests, independent review and planning updates"
|
||||
],
|
||||
"excluded": [
|
||||
"performance_profiling_or_optimization",
|
||||
|
|
@ -23,7 +23,9 @@
|
|||
"candidate_execution",
|
||||
"provider_to_v2_inference",
|
||||
"multi_asset_activation",
|
||||
"other_backlog_tasks"
|
||||
"other_backlog_tasks",
|
||||
"R04_workspace_UI",
|
||||
"AI_execution_or_credentials"
|
||||
],
|
||||
"pending_policy_decisions": [
|
||||
"ADR-007",
|
||||
|
|
@ -1500,7 +1502,7 @@
|
|||
"epic": "E6",
|
||||
"priority": "P1",
|
||||
"severity": "High",
|
||||
"status": "ready",
|
||||
"status": "review",
|
||||
"dependencies": [
|
||||
"R01",
|
||||
"R10"
|
||||
|
|
@ -1521,12 +1523,34 @@
|
|||
"research-api"
|
||||
],
|
||||
"parallel_policy": "Allowed only with satisfied dependencies/approvals and disjoint write locks AND actual files; see agents/integration.md.",
|
||||
"assignment": null,
|
||||
"assignment": "/root",
|
||||
"branch": null,
|
||||
"pull_request": null,
|
||||
"completed_commit": null,
|
||||
"blocker": null,
|
||||
"release_gates": []
|
||||
"release_gates": [],
|
||||
"integration_base": "618fb9e33cebc1fde4869eb1f975a12c55bd9b94",
|
||||
"integration_state": "validated_uncommitted",
|
||||
"worktree": "/home/boki/repos/stock-bot",
|
||||
"implementation_slices": [
|
||||
{
|
||||
"owner": "/root",
|
||||
"scope": "Shared pure research DTOs, evidence projection, fixture/composition integration and planning"
|
||||
},
|
||||
{
|
||||
"owner": "/root/r03_persistence",
|
||||
"worktree": "/tmp/stock-bot-wave24.3Qsd1y/persistence",
|
||||
"scope": "Migration20, research metadata service and PostgreSQL tests"
|
||||
},
|
||||
{
|
||||
"owner": "/root/r03_http",
|
||||
"worktree": "/tmp/stock-bot-wave24.3Qsd1y/http",
|
||||
"scope": "Research route adapter and HTTP boundary tests"
|
||||
}
|
||||
],
|
||||
"reviewed_by": "/root/r03_contract_review",
|
||||
"review_notes": "Independent review accepted metadata/revision/evidence contracts, persistence and HTTP boundaries after transaction-client forwarding and retained-corruption error fixes. Full repository, SQL and existing browser gates pass.",
|
||||
"verification_reference": "ROADMAP.md#twenty-fourth-wave-handoff--2026-10-23"
|
||||
},
|
||||
{
|
||||
"id": "R04",
|
||||
|
|
@ -1604,7 +1628,7 @@
|
|||
"release_gates": [
|
||||
"Explicit owner disposition of the simultaneous multi-asset mark/risk policy before canonical default activation"
|
||||
],
|
||||
"integration_state": "partial_validated_uncommitted",
|
||||
"integration_state": "partial_validated_committed",
|
||||
"integration_base": "d929db707a4894096b8b31ebd25c5e39d15289c1",
|
||||
"worktree": "/home/boki/repos/stock-bot",
|
||||
"implementation_slices": [
|
||||
|
|
@ -1634,7 +1658,8 @@
|
|||
"/root/s04_feed_audit"
|
||||
],
|
||||
"verification_reference": "ROADMAP.md#twenty-third-wave-handoff--2026-10-23",
|
||||
"review_notes": "Reviewed retained-builtin/single-asset vertical slice only. Full R05 remains in progress; provider-to-v2 preparation and broader cutover are not claimed. Corrected warmup clock, series/rate/decimal admission mismatches, concurrent approval proof, UI parent identity and drawdown severity."
|
||||
"review_notes": "Reviewed retained-builtin/single-asset vertical slice only. Full R05 remains in progress; provider-to-v2 preparation and broader cutover are not claimed. Corrected warmup clock, series/rate/decimal admission mismatches, concurrent approval proof, UI parent identity and drawdown severity.",
|
||||
"partial_commit": "618fb9e33cebc1fde4869eb1f975a12c55bd9b94"
|
||||
},
|
||||
{
|
||||
"id": "R06",
|
||||
|
|
@ -7210,5 +7235,100 @@
|
|||
],
|
||||
"cleanup": "Both exact --rm disposable PostgreSQL/Redis containers stopped; development services untouched. Worktrees and evidence logs retained.",
|
||||
"next": "After acceptance/commit, R03 research projects, hypotheses and evidence-linked findings APIs is independently ready. Keep R05 in progress until explicit source-v2 preparation and broader cutover scope are completed; R06/S06 remain blocked."
|
||||
},
|
||||
"twenty_fourth_wave": [
|
||||
"R03"
|
||||
],
|
||||
"twenty_fourth_wave_base": "618fb9e33cebc1fde4869eb1f975a12c55bd9b94",
|
||||
"twenty_fourth_wave_notes": [
|
||||
"Metadata and retained-evidence APIs only; no R04 UI or AI execution/credentials. Narratives remain unvalidated; citations resolve existing retained results, not copied metrics.",
|
||||
"R05 stays in progress after accepted single-asset slice. Performance work remains paused."
|
||||
],
|
||||
"twenty_fourth_wave_validation": {
|
||||
"state": "validated_uncommitted",
|
||||
"log_directory": "/tmp/stock-bot-wave24.3Qsd1y",
|
||||
"integration_base": "618fb9e33cebc1fde4869eb1f975a12c55bd9b94",
|
||||
"source_archive": "/tmp/stock-bot-wave24.3Qsd1y/r03-integrated-source.tar",
|
||||
"source_archive_sha256": "645d9d80a574b1e590023c601aca563f18101ef19b0aafbd03181159665e8d32",
|
||||
"source_file_count": 18,
|
||||
"source_sha256": {
|
||||
"apps/stock/config/package.json": "d2f8581c02e16c90fa5154ed9a1223bc26256ec4c6e29146d5d454cba5fe435e",
|
||||
"apps/stock/config/src/contracts/research.ts": "60b41535e9ce81a538013e6299dc363a68826eab0d969dfd492de1c1376cfb6e",
|
||||
"apps/stock/web-api/src/migrations/migration-runner.ts": "a3a8d885af0a5b6c3e1d1193101a3370fcd10c867443e13012ecb384f3b629cf",
|
||||
"apps/stock/web-api/src/routes/create-routes.ts": "5c2faa9e0f5825d0615ded19af9952281349c43651fd3c47b6e10e6b7e4526c5",
|
||||
"apps/stock/web-api/src/routes/research.routes.ts": "2a3805186faa5fb3f339c8183834e30038c98f7ca01f6ede8b9a247c559f1990",
|
||||
"apps/stock/web-api/src/services/backtest-v2.service.ts": "7f64f0244fd18e33bf50f99b960aab2c6e985615513e1d85367e8a1ce5a45e68",
|
||||
"apps/stock/web-api/src/services/research-errors.ts": "db90da45c8f4a091e3f113d50c6435d4283161995e7570f3cae05a626e745995",
|
||||
"apps/stock/web-api/src/services/research-evidence.ts": "7174448d404ec90249bcc83b8b1c178e393ede1aaf74f95c6cc8914031a34179",
|
||||
"apps/stock/web-api/src/services/research.service.ts": "f8436942a22bcbec0e40a7109e28d84459e4994568b54c564f1393146bc8a589",
|
||||
"database/postgres/init/20-research-workspace.sql": "c9202c23f218c6aa55ee44e6c25ae966cf90cb7e00b21352bac256b393048ec5",
|
||||
"libs/core/types/src/index.ts": "631c900226aef3bf3cc79e605d1f2cc28df5bbab6b3823595da090faad1303f2",
|
||||
"libs/core/types/src/research.ts": "5fd981488ac18edacbd92e1fe9e254afe27ef1388f5ef391f9fbda07a3bbe9c7",
|
||||
"scripts/test/architecture.test.ts": "0f30d5c99544e8420f75711f1a3c47d194c6d74b7bc0592a14b89c8d50a1ee58",
|
||||
"test/e2e/fixture.ts": "8c2c7c12d1b84adcded82e384065b12c1857e567fd302e2c9b46e71644e52ca1",
|
||||
"test/integration/research-api.test.ts": "c628c25d070bd613a34fe7edb593fee996cde74e8bec2f460620be91937220c4",
|
||||
"test/integration/research-evidence.test.ts": "f3cf3a2aa73b6dfc4e2944cbecd3a6db574ac3be9220b9bfccddb4bdb23f20cb",
|
||||
"test/postgres/migration-runner.test.ts": "b71a74cd4acf4c55dcbcad11a03ebaeefcaa7fcb70a01a0c8291ff1a91c47d27",
|
||||
"test/postgres/research-workspace.test.ts": "680a650516ccc9c91179119f5d357618a23b9b909b1310e6ee86ce8cdbd77452"
|
||||
},
|
||||
"checks": [
|
||||
{
|
||||
"command": "CARGO_BUILD_JOBS=2 bun run check",
|
||||
"log": "/tmp/stock-bot-wave24.3Qsd1y/check.log",
|
||||
"outcome": "All repository checks passed: build/source/contracts/secrets/lint; 93 tooling, 43 utility, 44 calculation, 590 integration and 150 Rust tests. Four manual Rust tests remain ignored."
|
||||
},
|
||||
{
|
||||
"command": "PIPELINE_TEST_DATABASE_URL=<disposable PG> BACKTEST_TEST_REDIS_URL=<dedicated Redis /15> bun run test:postgres",
|
||||
"log": "/tmp/stock-bot-wave24.3Qsd1y/postgres.log",
|
||||
"outcome": "159 tests / 1279 assertions passed across 18 files. Includes new research citations/revisions, one-connection pool, actual canonical execution, legacy conversion, SQL integrity, concurrent revisions/archive and upgrade/reapply preservation."
|
||||
},
|
||||
{
|
||||
"command": "CARGO_BUILD_JOBS=2 bun run --cwd apps/stock/engine build:release",
|
||||
"log": "/tmp/stock-bot-wave24.3Qsd1y/native-release.log",
|
||||
"outcome": "Release addon restored; SHA256 ef00eed556f5c32332d36a9a00ef710682e90deb00b54552e4b5c8bfdfbe8103 matches checkout release library and previous wave. No Rust financial source changes."
|
||||
},
|
||||
{
|
||||
"command": "PIPELINE_TEST_DATABASE_URL=<disposable PG> BACKTEST_TEST_REDIS_URL=<dedicated Redis /15> bun run test:e2e",
|
||||
"log": "/tmp/stock-bot-wave24.3Qsd1y/e2e.log",
|
||||
"outcome": "All 9 existing workflows / 164 assertions passed with migration20 and research routes installed, including retained canonical execution/reopen, legacy results, archive and cancellation. Research workspace UI itself remains R04."
|
||||
},
|
||||
{
|
||||
"command": "node_modules/.bin/tsc --project /tmp/stock-bot-wave24.3Qsd1y/tests-tsconfig.json --noEmit",
|
||||
"log": "/tmp/stock-bot-wave24.3Qsd1y/strict-tests.log",
|
||||
"outcome": "Strict new/changed test and dependent source types passed."
|
||||
},
|
||||
{
|
||||
"command": "node_modules/.bin/prettier --check <changed TypeScript/JSON>; node_modules/.bin/eslint <changed tests> --max-warnings 0; git diff --check",
|
||||
"log": "/tmp/stock-bot-wave24.3Qsd1y/scoped-format.log",
|
||||
"outcome": "Passed scoped formatting, test lint and diff checks; test lint log is scoped-test-lint.log."
|
||||
},
|
||||
{
|
||||
"command": "bun test test/integration/research-api.test.ts (isolated HTTP worktree)",
|
||||
"log": "/tmp/stock-bot-wave24.3Qsd1y/http-tests-final.log",
|
||||
"outcome": "10 tests / 197 assertions passed, including sanitized500 for valid citation of corrupt retained storage. Also covered by full root integration gate."
|
||||
},
|
||||
{
|
||||
"command": "PIPELINE_TEST_DATABASE_URL=<disposable PG> bun test test/postgres/research-workspace.test.ts (isolated persistence worktree)",
|
||||
"log": "/tmp/stock-bot-wave24.3Qsd1y/persistence-postgres-final.log",
|
||||
"outcome": "9 tests / 121 assertions passed; also covered by full root SQL gate."
|
||||
}
|
||||
],
|
||||
"reviews": [
|
||||
{
|
||||
"reviewer": "/root/r03_contract_review",
|
||||
"scope": "Pinned shared contracts, root resolver/result query seam, persistence/SQL and HTTP adapter",
|
||||
"outcome": "Accepted. Corrected nested pool deadlock by forwarding active client, preserved actor metadata, and classified corrupt retained-result validation as sanitized500 rather than client400. Reviewed final source and observed scoped passing logs; root ran combined gates."
|
||||
}
|
||||
],
|
||||
"limitations": [
|
||||
"R03 is API/data scope only. R04 owns project/hypothesis/finding screens and the browser save-finding workflow.",
|
||||
"Narratives always remain unvalidated. EvidenceState referenced is not narrative validation; submittedBy is verified operator/service while contentOrigin is declared human/ai/unknown. No authenticated model identity or AI execution credentials added.",
|
||||
"Only known scalar metric paths on completed retained results are citeable. Canonical/legacy reporting adapters remain distinct; legacy economics retain existing limitations and null metrics remain unavailable.",
|
||||
"Revision edits use expectedRevision; archive/history are retained. Ordinary metadata create POSTs have no submission receipt and must not be blindly retried after an ambiguous response.",
|
||||
"No source-v2 preparation, candidate execution, multi-asset/default activation, paper/live operations or new financial simulator. Partial R05 remains in progress.",
|
||||
"No profiling/optimization/benchmarks, new-wave commit, push or PR. No production/development schema or data mutation."
|
||||
],
|
||||
"cleanup": "Both exact --rm PostgreSQL/Redis fixtures stopped. After interruption, docker ps -a --filter name=stock-bot-research-workspace returned no containers. All 18 source hashes reverified unchanged. Worktrees and logs retained; development services untouched.",
|
||||
"next": "After acceptance/commit, R04 research workspace and evidence-linked save-finding UI. Keep R05 partial and R06/S06 gated. Performance remains paused."
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,3 +63,35 @@ Keep migrations additive and previous results readable. Do not add a switch that
|
|||
## Handoff
|
||||
|
||||
Report scope changes (if any), fixture expectations, API/schema changes, measurements, remaining limitations and commit/PR references once authorized. Request independent review; only the integration/planning owner may mark the manifest done.
|
||||
|
||||
## Implemented contract — 2026-10-23
|
||||
|
||||
R03 adds metadata APIs only; R04 owns the research workspace screens. Migration 20 introduces projects, hypotheses and their revisions, note/finding artifacts and their revisions, evidence references, and project/strategy membership. Existing runs, results, strategy versions, queues and financial engines are reused unchanged. The implementation is in `services/research.service.ts`, `services/research-evidence.ts`, `routes/research.routes.ts` and pure DTOs/schemas at `libs/core/types/src/research.ts` and `@stock-bot/stock-config/research`.
|
||||
|
||||
Every narrative revision remains `validationState: 'unvalidated'`. `evidenceState: 'referenced'` means citations exist, not that the conclusion is true. `submittedBy` comes from verified operator/service credentials; `contentOrigin: human | ai | unknown` is explicitly declared provenance. Operator submissions default to human, service submissions to unknown; a service cannot claim human authorship. Operator imports may be labelled AI. No model identity, AI credential system, approval workflow or trading authority is inferred.
|
||||
|
||||
Project edits require `expectedRevision`; actual strategy-link changes also advance it and record the actor. Hypothesis/artifact content changes append a complete immutable revision under the project/entity lock and require the current ordinal. A stale editor receives 409. Archive/restore preserves history and records the latest metadata actor/time. Archived projects reject child writes; archived records remain readable. A finding can link an exact hypothesis revision from the same project; later hypothesis edits/archive never rewrite that link or prevent independent revisions of an existing finding.
|
||||
|
||||
Findings require at least one reference; notes may have none. References contain `runId`, `metricsVersion`, `metricPath` and optionally a matching retained `strategyVersionId`. They have foreign keys to retained result/version rows and never store copied metric values. Only the known scalar paths in the shared schema are accepted. `canonical-analytics/v1` reads accepted F08 analytics; `legacy-display/v1` versions the existing compatibility reader, **not** a recorded legacy engine or financial policy. Completed runs/results are required. Null stays unavailable with its reason, zero stays zero, fractions are not rescaled, fills do not become round trips, and legacy/model limitations accompany measurements.
|
||||
|
||||
Reads use `BacktestServiceV2.getRunResults`; an optional query client lets evidence resolution share the active metadata transaction. This prevents a nested-pool deadlock with one connection. SQL rejects revision/reference update/delete/truncate, dangling references and later insertion into an old revision's evidence set. Reference creation is limited to its narrative revision's creation transaction, with a deferred nonempty-finding check. There is no second metric store or simulator.
|
||||
|
||||
### API for R04 and other authorized clients
|
||||
|
||||
All routes use `/api/v2`; list payloads may be empty and mutations require real credentials even when development authentication bypass is enabled. Each route sets `Cache-Control: no-store` without changing unrelated APIs.
|
||||
|
||||
| Resource | Operations |
|
||||
| --- | --- |
|
||||
| `/research-projects` | GET `{projects}`; POST `{title, description?}` → 201 `{project}` |
|
||||
| `/research-projects/:id` | GET `{project}`; PATCH `{expectedRevision, title?, description?, archived?}` |
|
||||
| `/research-projects/:id/strategies` | GET `{strategies}`; PUT/DELETE `/:strategyId` → 204, no body or `{}` |
|
||||
| `/research-projects/:id/hypotheses` | GET `{hypotheses}`; POST `{title, proposition, validationCriteria?, contentOrigin?}` → 201 `{hypothesis}` |
|
||||
| `/hypotheses/:id` | GET `{hypothesis}`; PATCH `{archived}` |
|
||||
| `/hypotheses/:id/revisions` | GET ascending `{revisions}`; POST full new content + `expectedRevision` → 201 `{hypothesis}` |
|
||||
| `/research-projects/:id/analysis-artifacts` | GET `{artifacts}`; POST `{kind, title, body, hypothesisRevisionId?, contentOrigin?, evidence?}` → 201 `{artifact}` |
|
||||
| `/analysis-artifacts/:id` | GET `{artifact}`; PATCH `{archived}` |
|
||||
| `/analysis-artifacts/:id/revisions` | GET ascending `{revisions}`; POST full narrative/evidence + `expectedRevision` → 201 `{artifact}` |
|
||||
|
||||
Project/hypothesis/artifact lists accept `includeArchived=true|false`. Missing resources return 404; stale revisions and archived writes 409; malformed bodies/unknown metric selectors 400; a valid reference incompatible with its retained result 422. Corrupt retained results return a sanitized 500 with internal diagnostics, not a false client-input error. No hard-delete, execution or validation-promotion endpoint exists. Initial metadata creation uses ordinary POST semantics; clients should not automatically retry an ambiguous creation response as though it had an idempotency receipt.
|
||||
|
||||
Mandatory cases are covered by `test/postgres/research-workspace.test.ts`, `test/integration/research-api.test.ts` and `test/integration/research-evidence.test.ts`. The PostgreSQL fixture includes a real retained native run, legacy conversion, exact revisions, direct-SQL guards, concurrent edits/archive, a one-connection pool and migration upgrade/reapply preservation. Combined validation and reviewed source hashes are recorded in the manifest's twenty-fourth-wave handoff. No production/development schema or catalog was changed during implementation.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue