-
Notifications
You must be signed in to change notification settings - Fork 1
feat: record the seeded period report on the analysis-run registry (v0.86.4) #161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
ac7eada
68dc391
a2309b3
5437295
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| Related-node walks include team and organization mention edges. Click an | ||
| R&R team to open sibling posts. Thread-group run lists honor knowledge_cutoff. | ||
| Failed period-report rows rebuild the report; a pending TEPP corpus | ||
| does not claim a calibrated measurement. | ||
| does not claim a calibrated measurement. A pending lineage row says | ||
| reconstruction has not started yet. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| Seed records the built Demo Corp period report as a Succeeded | ||
| analysis-run registry row on the shared snapshot (ADR 0022). Mean θ | ||
| stays on the period-report panel. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,18 +5,21 @@ ADRs under `docs/adr/`. Do not fork those rules here. | |
|
|
||
| ## Analysis-run seed (v0.85.0) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Heading still says v0.85.0 while the body now describes the ADR 0022 third registry row. After rebase, keep the v0.87.0 retention section from |
||
|
|
||
| `make seed` writes a Demo Corp lineage run and a TEPP run on the same | ||
| snapshot (ADR 0013). The TEPP path goes through `tepp_client`. A missing | ||
| `make seed` writes a Demo Corp lineage run, a TEPP run, and a Succeeded | ||
| period-report run on the same snapshot (ADR 0013 / ADR 0022). The TEPP path goes through `tepp_client`. A missing | ||
| transport or an unused accepted envelope is Failed | ||
| (`tepp_not_available` / `tepp_result_not_persisted`). Do not invent a | ||
| theta or a local psychometric substitute. The home list caption stays | ||
| `kind · status · entity`; the machine failure code is detail-only | ||
| (ADR 0014). Open a Failed TEPP row, then connect a live TEPP | ||
| transport. A failed lineage row retries reconstruction -- it does not | ||
| mention TEPP. A failed period-report row rebuilds the report. A | ||
| pending TEPP row does not claim a calibrated measurement. | ||
| pending TEPP row does not claim a calibrated measurement. A pending | ||
| lineage row says reconstruction has not started yet. | ||
| Digest prefixes stay audible; hover a prefix to read the full digest. | ||
| Opening a cutoff title shows the live post -- compare it with the | ||
| cutoff before treating the body as reconstructed evidence (ADR 0016). | ||
| `POST /api/analysis-runs` records Pending on an authorized | ||
| cutoff capture (ADR 0017) and does not reconstruct lineage. | ||
| After `make seed`, open **Period report · Succeeded · Demo Corp** | ||
| to confirm the cutoff posts; mean θ stays on the period-report panel. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| # ADR 0022 — Seed records the built period report on the shared snapshot | ||
|
|
||
| **Decision status:** Accepted on this active PR; not protected-main truth until merge | ||
| **Date:** 2026-08-16 | ||
| **Depends on:** ADR 0013 normalized analysis-run registry; ADR 0003 | ||
| fast-mlsirm report integration; ADR 0014 authorized analysis-run read | ||
| **Refs:** After `make seed`, lineage and TEPP registry rows were visible | ||
| on home Analysis runs, but the calibrated period report lived only on | ||
| the separate report panel. ADR 0021 is the person-catalog bind on #153. | ||
|
|
||
| ## Context | ||
|
|
||
| Seed already scores Demo Corp week-2/week-3 reports through | ||
| `fast-mlsirm` and persists them on the report tables. The analysis-run | ||
| registry already has `analysis_run_report`. Operators who opened | ||
| Analysis runs after `make seed` could retry a Failed TEPP transport or | ||
| inspect a Succeeded lineage tree, then had no registry row for the | ||
| report they could already see on the period-report panel. | ||
|
|
||
| A fake Failed report row would contradict the built report. Copying | ||
| mean θ onto `analysis_run` would invent a psychometric field the | ||
| registry is not allowed to store (ADR 0013). | ||
|
|
||
| ## Decision | ||
|
|
||
| - `_seed_demo_period_report` still builds the calibrated report first. | ||
| - `_seed_demo_report_run` then inserts `analysis_run_report` on the | ||
| same Demo Corp snapshot, scoped to the same corporate entity. | ||
| - The lifecycle is Pending → Running → Succeeded because the report | ||
| tables already hold the scored period. The run row stores only | ||
| registry digests and counts — never a theta, item bank, or provider | ||
| body. | ||
| - Home next-action copy for a Succeeded report stays empty. Failed | ||
| report fixtures still say rebuild the period report. | ||
| - `POST /api/analysis-runs` stays lineage-or-TEPP as implemented | ||
| (ADR 0017). This slice does not add a Request period-report button | ||
| and does not call TEPP. | ||
|
|
||
| ## Consequences | ||
|
|
||
| After `make seed`, Demo Analyst opens Analysis runs and sees | ||
| **Period report · Succeeded · Demo Corp** next to the lineage and TEPP | ||
| rows. Opening it shows the cutoff posts. Mean θ remains on the | ||
| period-report panel. Re-seed is idempotent on | ||
| `demo-report-seed-2026-w02`. | ||
|
|
||
| ## References — APA 7th | ||
|
|
||
| American Educational Research Association, American Psychological | ||
| Association, & National Council on Measurement in Education. (2014). | ||
| *Standards for educational and psychological testing*. American | ||
| Educational Research Association. | ||
|
|
||
| International Organization for Standardization. (2019). *ISO 8601-1:2019: | ||
| Date and time—Representations for information interchange—Part 1: Basic | ||
| rules* (confirmed 2024; Amendment 1:2022). | ||
|
|
||
| Moreau, L., & Missier, P. (Eds.). (2013). *PROV-DM: The PROV data model*. | ||
| World Wide Web Consortium. https://www.w3.org/TR/prov-dm/ | ||
|
|
||
| World Wide Web Consortium. (2022). *Time ontology in OWL* (W3C | ||
| Recommendation). https://www.w3.org/TR/owl-time/ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -61,6 +61,7 @@ describe("App, authenticated", () => { | |
| verificationEvidenceUrl?: string | null; | ||
| failedLineageRun?: boolean; | ||
| failedReportRun?: boolean; | ||
| succeededReportRun?: boolean; | ||
| succeededTeppRun?: boolean; | ||
| pendingTeppRun?: boolean; | ||
| postBody?: string; | ||
|
|
@@ -175,6 +176,7 @@ describe("App, authenticated", () => { | |
| ); | ||
| } | ||
| if (url.endsWith("/api/analysis-runs/run-demo-report")) { | ||
| const reportSucceeded = Boolean(options?.succeededReportRun); | ||
| return Promise.resolve( | ||
| jsonResponse({ | ||
| analysis_run_id: "run-demo-report", | ||
|
|
@@ -183,8 +185,8 @@ describe("App, authenticated", () => { | |
| scope_kind_code: "analysis_scope_corporate_entity", | ||
| scope_kind_label: "Corporate entity", | ||
| scope_entity_name: "Demo Corp", | ||
| status_code: "analysis_status_failed", | ||
| status_label: "Failed", | ||
| status_code: reportSucceeded ? "analysis_status_succeeded" : "analysis_status_failed", | ||
| status_label: reportSucceeded ? "Succeeded" : "Failed", | ||
| knowledge_cutoff: "2026-01-12T12:00:00Z", | ||
| requested_at: "2026-01-12T12:38:00Z", | ||
| source_counts: [ | ||
|
|
@@ -194,22 +196,45 @@ describe("App, authenticated", () => { | |
| count_value: 3, | ||
| }, | ||
| ], | ||
| visible_posts: [], | ||
| status_history: [ | ||
| { | ||
| status_ordinal: 1, | ||
| status_code: "analysis_status_pending", | ||
| status_label: "Pending", | ||
| occurred_at: "2026-01-12T12:39:00Z", | ||
| }, | ||
| { | ||
| status_ordinal: 2, | ||
| status_code: "analysis_status_failed", | ||
| status_label: "Failed", | ||
| occurred_at: "2026-01-12T12:40:00Z", | ||
| failure_code: "period_report_rebuild_failed", | ||
| }, | ||
| ], | ||
| visible_posts: reportSucceeded | ||
| ? [{ post_id: "post-1", post_title: "Public post" }] | ||
| : [], | ||
| status_history: reportSucceeded | ||
| ? [ | ||
| { | ||
| status_ordinal: 1, | ||
| status_code: "analysis_status_pending", | ||
| status_label: "Pending", | ||
| occurred_at: "2026-01-12T12:39:00Z", | ||
| }, | ||
| { | ||
| status_ordinal: 2, | ||
| status_code: "analysis_status_running", | ||
| status_label: "Running", | ||
| occurred_at: "2026-01-12T12:40:00Z", | ||
| }, | ||
| { | ||
| status_ordinal: 3, | ||
| status_code: "analysis_status_succeeded", | ||
| status_label: "Succeeded", | ||
| occurred_at: "2026-01-12T12:41:00Z", | ||
| }, | ||
| ] | ||
| : [ | ||
| { | ||
| status_ordinal: 1, | ||
| status_code: "analysis_status_pending", | ||
| status_label: "Pending", | ||
| occurred_at: "2026-01-12T12:39:00Z", | ||
| }, | ||
| { | ||
| status_ordinal: 2, | ||
| status_code: "analysis_status_failed", | ||
| status_label: "Failed", | ||
| occurred_at: "2026-01-12T12:40:00Z", | ||
| failure_code: "period_report_rebuild_failed", | ||
| }, | ||
| ], | ||
| }), | ||
| ); | ||
| } | ||
|
|
@@ -408,7 +433,7 @@ describe("App, authenticated", () => { | |
| }, | ||
| ], | ||
| }, | ||
| ...(options?.failedReportRun | ||
| ...(options?.failedReportRun || options?.succeededReportRun | ||
| ? [ | ||
| { | ||
| analysis_run_id: "run-demo-report", | ||
|
|
@@ -417,8 +442,10 @@ describe("App, authenticated", () => { | |
| scope_kind_code: "analysis_scope_corporate_entity", | ||
| scope_kind_label: "Corporate entity", | ||
| scope_entity_name: "Demo Corp", | ||
| status_code: "analysis_status_failed" as const, | ||
| status_label: "Failed", | ||
| status_code: options?.succeededReportRun | ||
| ? ("analysis_status_succeeded" as const) | ||
| : ("analysis_status_failed" as const), | ||
| status_label: options?.succeededReportRun ? "Succeeded" : "Failed", | ||
| knowledge_cutoff: "2026-01-12T12:00:00Z", | ||
| requested_at: "2026-01-12T12:38:00Z", | ||
| source_counts: [ | ||
|
|
@@ -1737,6 +1764,31 @@ describe("App, authenticated", () => { | |
| expect(teppButton).not.toHaveTextContent("reconstruction"); | ||
| }); | ||
|
|
||
| it("does not tell a succeeded period report to rebuild, reconstruct, or measure", async () => { | ||
| stubBackend({ succeededReportRun: true }); | ||
| render(<App />); | ||
|
|
||
| const reportButton = await screen.findByRole("button", { | ||
| name: "Open analysis run: Period report · Succeeded · Demo Corp", | ||
| }); | ||
| expect(reportButton).not.toHaveTextContent("rebuild the period report"); | ||
| expect(reportButton).not.toHaveTextContent("Reconstruction has not started yet"); | ||
| expect(reportButton).not.toHaveTextContent("measurement service"); | ||
| expect(reportButton).not.toHaveTextContent("θ"); | ||
|
|
||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This locks rebuild / reconstruction / measurement / θ off the Succeeded report row. Also forbid the pending-report sentence ( |
||
| await userEvent.click(reportButton); | ||
| expect( | ||
| await screen.findByRole("heading", { name: "Period report · Succeeded · Demo Corp" }), | ||
| ).toBeInTheDocument(); | ||
| expect(screen.queryByText(/rebuild the period report/)).not.toBeInTheDocument(); | ||
| expect(screen.queryByText(/Reconstruction has not started yet/)).not.toBeInTheDocument(); | ||
| expect( | ||
| screen.getByRole("button", { | ||
| name: "Open live post (may have changed after cutoff): Public post", | ||
| }), | ||
| ).toBeInTheDocument(); | ||
| }); | ||
|
|
||
| it("does not tell a failed period report to connect the measurement service", async () => { | ||
| stubBackend({ failedReportRun: true }); | ||
| render(<App />); | ||
|
|
@@ -1772,6 +1824,7 @@ describe("App, authenticated", () => { | |
| ).toBeInTheDocument(); | ||
| expect(screen.queryByText(/replace Failed/i)).not.toBeInTheDocument(); | ||
| expect(screen.queryByText(/this TEPP run measured/i)).not.toBeInTheDocument(); | ||
| expect(screen.queryByText(/Reconstruction has not started yet/)).not.toBeInTheDocument(); | ||
| }); | ||
|
|
||
| it("does not tell a succeeded TEPP run to replace Failed", async () => { | ||
|
|
@@ -1799,7 +1852,11 @@ describe("App, authenticated", () => { | |
| expect( | ||
| await screen.findByRole("heading", { name: "Lineage reconstruction · Pending · Demo Corp" }), | ||
| ).toBeInTheDocument(); | ||
| expect(screen.getByText(/has not started yet/)).toBeInTheDocument(); | ||
| expect( | ||
| screen.getByText( | ||
| "Open this run to confirm which posts it will use. Reconstruction has not started yet.", | ||
| ), | ||
| ).toBeInTheDocument(); | ||
| const postCall = fetchMock.mock.calls.find( | ||
| (call) => String(call[0]).endsWith("/api/analysis-runs") && call[1]?.method === "POST", | ||
| ); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Target
feat/role-responsibility-agent-ontologyis now69c035b/ v0.87.0 (ADR 0020 purge + Storybook tokens). Landing this as 0.86.4 would downgrade the feature-branch version.Rebase onto that tip, keep the 0.87.0 notes, and record this slice as 0.87.1. ADR 0022 stays; do not renumber it onto 0020 or 0021.