-
Notifications
You must be signed in to change notification settings - Fork 1
feat: apply analysis-run knowledge cutoff to visible posts (v0.83.0) #110
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
Closed
seonghobae
wants to merge
2
commits into
feat/role-responsibility-agent-ontology
from
feat/analysis-run-cutoff-posts
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # 0.83.0 analysis-run cutoff-scoped posts | ||
|
|
||
| Detail lists only posts known at the run knowledge cutoff and shows | ||
| revision/config digest prefixes so an operator can confirm the run | ||
| they approved. After `make seed`, Demo public post still opens; Late | ||
| Demo public post stays hidden. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| # CLAUDE.md | ||
|
|
||
| Read [AGENTS.md](AGENTS.md) first. Product architecture lives in | ||
| [ARCHITECTURE.md](ARCHITECTURE.md). Active analysis-run decisions are | ||
| ADR 0013–0016 under `docs/adr/`. | ||
|
|
||
| This repository ships synthetic data only. Do not add fixtures, tests, | ||
| or examples derived from a real organization's records. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| # ADR 0016 — Analysis-run post lists apply the run knowledge cutoff | ||
|
|
||
| **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 0014 authorized analysis-run read | ||
| **Refs:** Issue #79 (Milestone 2 parent); PR #89 registry + read projection | ||
|
|
||
| ## Context | ||
|
|
||
| PR #89 stores `knowledge_cutoff` on each `analysis_run` and ADR 0013 | ||
| requires that a run may use only evidence available at that cutoff. | ||
| The v0.82 authorized detail listed every ABAC-visible post in the run | ||
| scope. A post written after the cutoff therefore appeared inside a | ||
| historical reconstruction. That is the buyer-visible temporal leak: | ||
| an operator cannot trust that "this run" is the evidence the run was | ||
| allowed to know. | ||
|
|
||
| The registry already distinguishes snapshot availability from run | ||
| cutoff (Jensen & Snodgrass, 1999; W3C Time Ontology in OWL, 2022). | ||
| The read projection must apply the same as-of predicate when it | ||
| projects `source_post` titles. | ||
|
|
||
| ## Decision | ||
|
|
||
| `GET /api/analysis-runs/{id}` includes a post title only when: | ||
|
|
||
| 1. the post is in the run's scope; | ||
| 2. the caller already has ABAC authority to see that post; | ||
| 3. `source_post.created_at <= analysis_run.knowledge_cutoff`. | ||
|
|
||
| Hidden or later posts never appear. The list payload stays | ||
| aggregates-only. Detail also returns `code_revision_sha` and | ||
| `configuration_sha256` so an operator can confirm the run matches | ||
| the code and configuration they approved. Prefixes are shown in the | ||
| home panel; full digests remain on the API. | ||
|
|
||
| The home Analysis runs panel lives in `AnalysisRunsPanel` so the | ||
| repeating list/detail object can be inventoried for Storybook without | ||
| growing `App.tsx`. | ||
|
|
||
| ## Consequences | ||
|
|
||
| Fixture posts that belong in a January 2026 run must carry a | ||
| `created_at` at or before that cutoff. `make seed` stamps Demo public | ||
| and Demo private posts at 2026-01-10 and inserts Late Demo public post | ||
| at 2026-01-13 as the falsifiable own-corp counter-example. Write/rebuild | ||
| APIs, TEPP submission, and run-scoped post bodies remain later slices. | ||
|
|
||
| ## References | ||
|
|
||
| Jensen, C. S., & Snodgrass, R. T. (1999). Temporal data management. | ||
| *IEEE Transactions on Knowledge and Data Engineering, 11*(1), 36–44. | ||
| https://doi.org/10.1109/69.755613 | ||
|
|
||
| Snodgrass, R. T. (Ed.). (1995). *The TSQL2 temporal query language*. | ||
| Springer. https://doi.org/10.1007/978-1-4615-2289-8 | ||
|
|
||
| World Wide Web Consortium. (2022). *Time ontology in OWL* (W3C | ||
| Recommendation). https://www.w3.org/TR/owl-time/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| # Storybook inventory | ||
|
|
||
| **Status:** Component inventory for the repeating home-page objects. | ||
| Storybook itself is the next frontend toolchain slice; do not add a | ||
| second Node package manager while adding it (`frontend/mise.toml` | ||
| pins Node 24, Corepack pnpm only). | ||
|
|
||
| ## Repeating objects | ||
|
|
||
| | Object | Module | States a Storybook story must cover | | ||
| |---|---|---| | ||
| | Analysis run list | `frontend/src/AnalysisRunsPanel.tsx` | empty (`make seed` hint), loading, one succeeded Demo Corp run, hidden-run error | | ||
| | Analysis run detail | same | cutoff + requested date, status history, digest prefixes, in-cutoff posts, no posts at cutoff | | ||
| | Post list chip | `frontend/src/App.tsx` | public / private badges | | ||
| | Calendar commitment | `frontend/src/App.tsx` | dated open ticket | | ||
| | Period report row | `frontend/src/App.tsx` | mean θ, CAT item, member click-through | | ||
| | Post popup | `frontend/src/App.tsx` | summary, lineage, Keyman, tickets, chat | | ||
|
|
||
| ## Design tokens | ||
|
|
||
| Repeating chips, badges, and list rows must use the CSS custom | ||
| properties in `frontend/src/index.css` (`--lw-space-*`, | ||
| `--lw-radius-*`, `--lw-color-danger`) rather than one-off hex values | ||
| when those objects are next extracted. | ||
|
|
||
| ## Next action | ||
|
|
||
| Add Storybook via `pnpm` in `frontend/` with `@storybook/react-vite`, | ||
| then write CSF stories for `AnalysisRunsPanel` first. Keep stories on | ||
| synthetic Demo Corp fixtures only. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
seeded_dbnow has a fourth own-corp private post.GET /api/postsis not cutoff-scoped, sotest_post_list_includes_public_and_own_corp_but_excludes_other_corpstill asserting{"Public post", "Own-corp private post"}(line 523, outside this hunk) will fail when the live API suite runs. The fixture docstring still says three rows.Include
Late own-corp private postin that exact set, or insert the late post only inside the analysis-run test. Also GEThidden_all_visible_idand expect 404 — list exclusion alone does not prove the detail path.