Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions doc/agile/versions/v0/sprint_02/keep_blame_cheap/story.org
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
:PROPERTIES:
:ID: 23F4C8A3-5B63-4FF3-BA38-EE0803B3B4F7
:END:
#+title: Story: Keep blame inside a gate's time
#+description: A gate that blames the findings already on main finishes within seconds: the history blame reads is walked once for all findings, not once per finding.
#+type: story
#+level: s2
#+filetags: :blame:gates:sprint_02:v0:
#+created: 2026-12-05
#+updated: 2026-12-05
#+environment:
#+todo: BACKLOG STARTED | DONE ABANDONED

This page documents a [[id:699A8D45-B67E-4D3E-9206-24FA17C51ADA][story]] in [[id:B60924CC-92F3-47FD-9285-7A023412EA0B][Sprint 2]]. It captures the goal, current status, acceptance criteria, and the tasks that compose it.

* Goal

A gate run that blames the findings already on main finishes in the time the
rest of the gate takes, on a project of ORE Studio's age and size. Today it
does not: on =ores_dev_bright_faraday=, =compass 0.0.15= spent 168 s in git
within the first 200 s of the blame pass, and the pass had not finished; with
=--no-blame= the same ratchet finished in 110 s. The culprit is one
=git log -1 --follow --diff-filter=A= walk per finding that needs its addition
commit: rename detection over the whole history costs 8-15 s per call, and a
tree with 277 inherited findings makes the pass longer than the 900 s gate
timeout the ORE Studio fleet hit.

The fix is to read history once for all findings and answer each from that
read, so the git calls blame makes do not grow with the number of findings.

* Status

| Field | Value |
|---------------+----------------------------------------|
| State | STARTED |
| Parent sprint | [[id:B60924CC-92F3-47FD-9285-7A023412EA0B][Sprint 2]] |
| Now | The batch is in review as #285: the ORE Studio pass fell from over 300 s (killed) to 111.6 s. |
| Waiting on | Nothing. |
| Next | Batch the added-file walk, then measure the pass on the ORE Studio tree. |
| Last touched | 2026-12-05 |

* Acceptance

- On =ores_dev_bright_faraday=, =compass check --ratchet= with blame
completes in the same order of time as =--no-blame=, not minutes longer.
- The number of git processes a blame pass starts does not grow with the
number of findings, only with the number of distinct paths.
- A finding whose file cannot be traced still states why, and the culprits
blame names are unchanged for files added once and never renamed.

* Tasks

| Task | State | Start | End | Description |
|------+-------+-------+-----+-------------|
| [[id:CF50A53E-A47C-481F-8C52-57F3BC435DD0][Batch the added-file walk]] | STARTED | | | One history walk names the commit that added every path blame asks about, instead of a --follow walk per finding. |

* Decisions

- Blame is provenance, not a verdict. A slow blame never changes what the
ratchet decides, so a project may run =--no-blame= while this is fixed; the
gate in ORE Studio does so and records the reason.
- The batch replaces rename detection with the path as it is now. A file that
was renamed before it was blamed may name its addition under another path;
blame says it found no addition rather than walking history per path.

* Out of scope

- The bisect method, which runs the check at merges; it is off unless the
caller asks for =--blame=bisect= and is not what this story measures.
- The pull-request lookup, which is already cached per commit.
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
:PROPERTIES:
:ID: CF50A53E-A47C-481F-8C52-57F3BC435DD0
:END:
#+title: Task: Batch the added-file walk
#+description: One history walk names the commit that added every path blame asks about, instead of a --follow walk per finding.
#+type: task
#+level: s1
#+filetags: :blame:gates:sprint_02:v0:keep_blame_cheap:
#+owner: marco
#+branch:
#+pr: 285
#+blocked_on:
#+blocked_since:
#+created: 2026-12-05
#+updated: 2026-12-05
#+environment:
#+todo: DISCOVERED BACKLOG STARTED BLOCKED | DONE ABANDONED

This page documents a [[id:31C868B9-306E-4282-BA8C-07E647021B34][task]] in the [[id:23F4C8A3-5B63-4FF3-BA38-EE0803B3B4F7][Keep blame inside a gate's time]] story. It captures the goal, current status, acceptance, and any notes or results.

* Goal

Blame names the commit that added a file from one map built by a single
history walk, instead of starting a =--follow= walk of the whole history for
each finding, so the blame pass of =check --ratchet= stays inside the time
the rest of the gate takes.

* Status

| Field | Value |
|--------------+----------------------------------------|
| State | STARTED |
| Parent story | [[id:23F4C8A3-5B63-4FF3-BA38-EE0803B3B4F7][Keep blame inside a gate's time]] |
| Now | The batch is in review as #285; the ORE Studio tree is remeasured. |
| Waiting on | Nothing. |
| Next | Land #285 and close the story. |
| Last touched | 2026-12-05 |

* Acceptance

- One =git log --diff-filter=A --name-only= walk answers every path that needs
an addition commit; no =--follow= call remains in blame.
- The parser of that output is a pure function with a test naming a path per
commit and the newest commit winning when a path was added twice.
- The blame pass on =ores_dev_bright_faraday= is remeasured with the same
command as the report.

* Plan

1. Add =parse_added_commits= to =ops/blame.hpp=: read the =--name-only=
output, keeping the first (newest) commit per path.
2. Give =tracer= an =added= map and one =load_added= that runs the walk with
the paths blame asks about as pathspecs.
3. Replace the =--follow= fallback in =blame_added= with a map lookup; keep
the =subject_text= search and the note when neither answers.
4. Test the parser; measure the pass on the ORE Studio tree before and after.

* Measurements

Every number this task claims about a tree, with the command that produced it
and the commit it was measured at. A number without both is not a measurement,
because a clean-up record describes a tree and trunk moves under a branch: a
consumer count, a gate's component count and a suite's size all change with no
code changing, and the reader of a bare number cannot tell which tree it came
from. Where the raw output matters, put it in an =evidence/= file beside the
task and name that file in the Command column.

| What | Value | Command | Commit |
|------+-------+---------+--------|
| Ratchet without blame | 110.3 s | =compass check --ratchet --no-blame= | 6fe7adec, on =ores_dev_bright_faraday= |
| Ratchet with blame, before | >300 s, killed; 168 s in 63 git calls within the first 200 s | =compass check --ratchet= (0.0.15) | 6fe7adec, on =ores_dev_bright_faraday= |
| Ratchet with blame, after | 111.6 s; blame 81.9 s of it; 0 new diagnostics | =compass check --ratchet= | 6fe7adec, on =ores_dev_bright_faraday= |
| Git cost of the added-file walk | 4.4 s, one call (was 8-15 s per call, 90 or more calls) | =strace -f -e trace=execve= | 6fe7adec, on =ores_dev_bright_faraday= |

* Notes

* Test Scenarios

Manual QA scenarios (scaffolded via =compass add test_scenario=)
that verify this task. Link
new ones here as they're created; the scenario doc itself links back
via its "Verifies task" field.

| Scenario | State | Notes |
|----------+-------+-------|
| | | |

* PRs

| PR | Title |
|----+-------|
| 285 | [cli] Read the added-file history once for every finding |

* Review

| # | Comment summary | File | Decision | Notes |
|---+-----------------+------+----------+-------|
| | | | | |

* Result
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
:PROPERTIES:
:ID: 955957FD-5E73-41E8-B2C0-C9A6EE7997BD
:END:
#+title: Story: Run compass beside a project
#+description: Make the installed compass usable by a project: ship compass's documentation in the release and layer it into every environment, review and sign-off authored pages, run tests in development and production, and serve production readers.
#+type: story
#+level: s2
#+filetags: :compass:distribution:mcp:review:testing:sprint_02:v0:
#+created: 2026-12-05
#+updated: 2026-12-05
#+environment:
#+todo: BACKLOG STARTED | DONE ABANDONED

This page documents a [[id:699A8D45-B67E-4D3E-9206-24FA17C51ADA][story]] in [[id:B60924CC-92F3-47FD-9285-7A023412EA0B][Sprint 2]]. It captures the goal, current status, acceptance criteria, and the tasks that compose it.

* Goal

A project can use a released compass to search and ask about its own
documents and compass's, review and sign off the pages it writes, run its
test scenarios in development and in production, and get the results back to
its developers, behind gateway views and roles that admit only what each use
may write.

[[id:4CA0B3E0-B33D-47A3-BCC6-7BF9DEFBA7CF][Installed compass]] states what an
installation carries and separates the three uses this story serves: compass
development, ORE Studio development, and ORE Studio production.

* Status

| Field | Value |
|---------------+----------------------------------------|
| State | STARTED |
| Parent sprint | [[id:B60924CC-92F3-47FD-9285-7A023412EA0B][Sprint 2]] |
| Now | Captured with its six tasks; the architecture page is written. |
| Waiting on | Nothing. |
| Next | Ship compass's documentation in the release and layer it into every environment first; everything else needs it. |
| Last touched | 2026-12-05 |

* Acceptance

- A released compass carries its documentation under =share/compass/doc= and
a project needs no copy of compass's tree to use it.
- Every environment's search, agent and MCP answers questions about compass
itself from the shipped documents, under the project's own.
- A page can be put up for review; a reviewer signs it off or refuses it with
commentary, and the record is queryable.
- A reviewer can annotate a page's paragraphs inline without editing it.
- A testing team runs the sprint's scenarios against a deployed environment
and the recorded campaign reaches the development team's git.
- The production deployment serves the manual, the project's documents and
compass's through compass.web and MCP, behind a view that admits the
production documents and a role that admits test writes only.
- The three uses are documented in
[[id:4CA0B3E0-B33D-47A3-BCC6-7BF9DEFBA7CF][Installed compass]] and the
command surface does not confuse them.

* Tasks

| Task | State | Start | End | Description |
|------+-------+-------+-----+-------------|
| [[id:BBFD4646-1930-4BC8-AD1E-13495E0734F0][Ship compass's documentation beside the binary]] | BACKLOG | | | Copy the pages an installation needs into share/compass/doc and install them, so a released compass can describe itself and its tools. |
| [[id:1236ADF6-5EBA-402F-9F11-E3542AEB5FB5][Layer compass's documentation into every environment]] | BACKLOG | | | Search, the agent and the MCP server read compass's shipped documents under the project's, so an LLM can ask how to use compass and be answered. |
| [[id:C326D0F2-B559-482C-BA7E-D8E765BDE0FB][Author pages with review and sign-off]] | BACKLOG | | | A page can be put up for review; a reviewer signs it off or refuses it with commentary, and the decision is stored as a record. |
| [[id:6CAD6D96-B800-4B93-ADC9-3C0E7FF8C1FC][Annotate pages inline]] | BACKLOG | | | A reviewer leaves margin annotations on a page's paragraphs and their state, without editing the page. |
| [[id:B65B5CED-71AA-440E-B2C3-19D5562BCBC1][Run tests in production and route the results]] | BACKLOG | | | A testing team runs the sprint's scenarios against a deployed environment and the recorded campaign reaches the development team's git. |
| [[id:BB5F0800-1DD0-4E3A-B917-FF06209C7152][Serve production readers]] | BACKLOG | | | The production deployment serves the manual, the project's documents and compass's over compass.web's endpoints and MCP, with views and roles that admit test writes only. |

* Decisions

- *Project data stays with the project; generic MASD and compass's
documentation stay with compass.* The product owner's direction of
2026-12-05. ORE Studio will delete every MASD and compass page from its
tree, so a release that does not carry them leaves an LLM unable to use
compass.
- *The library and documentation are layers, not environments.* A project
syncs its own checkout; compass's shipped material is read under it, the
way codegen reads =@compass= under the project's library.
- *The overlay shape, not a rename.* The generic MASD keeps its addresses;
a project's own additions layer over it, so ORE Studio's output does not
change and its =ores.*= addresses stay valid.

* Out of scope

- Moving ORE Studio's remaining Split pages and families; that is
[[id:E3C81059-FE00-4403-AA56-190FDBB9904A][Own the MASD meta model]].

* Out of scope

-
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
:PROPERTIES:
:ID: 6CAD6D96-B800-4B93-ADC9-3C0E7FF8C1FC
:END:
#+title: Task: Annotate pages inline
#+description: A reviewer leaves margin annotations on a page's paragraphs and their state, without editing the page.
#+type: task
#+level: s1
#+filetags: :run_compass_beside_a_project:sprint_02:v0:
#+owner: marco
#+branch:
#+pr:
#+blocked_on:
#+blocked_since:
#+created: 2026-12-05
#+updated: 2026-12-05
#+environment:
#+todo: DISCOVERED BACKLOG STARTED BLOCKED | DONE ABANDONED

This page documents a [[id:31C868B9-306E-4282-BA8C-07E647021B34][task]] in the [[id:955957FD-5E73-41E8-B2C0-C9A6EE7997BD][Story: Run compass beside a project]] story. It captures the goal, current status, acceptance, and any notes or results.

* Goal

A reviewer leaves margin annotations on a page's paragraphs and their state,
without editing the page.

* Status

| Field | Value |
|--------------+----------------------------------------|
| State | BACKLOG |
| Parent story | [[id:955957FD-5E73-41E8-B2C0-C9A6EE7997BD][Story: Run compass beside a project]] |
| Now | Not yet started. |
| Waiting on | Nothing. |
| Next | Begin implementation. |
| Last touched | 2026-12-05 |

* Acceptance

- An annotation names a page, a heading or paragraph anchor, the reviewer,
the text and whether it is addressed.
- Annotations are stored, listed beside the page and resolvable without a
rewrite of the page's body.
- The page shows its annotations to a reader with the view's permission.

* Plan

1. Prototype the anchor: a heading's anchor or a paragraph's position and
its stability across edits.
2. Store and read them; decide whether they are a document type of their own.
3. Render them in the document view.
4. Verify on a page edited after its annotations.

* Measurements

Every number this task claims about a tree, with the command that produced it
and the commit it was measured at. A number without both is not a measurement,
because a clean-up record describes a tree and trunk moves under a branch: a
consumer count, a gate's component count and a suite's size all change with no
code changing, and the reader of a bare number cannot tell which tree it came
from. Where the raw output matters, put it in an =evidence/= file beside the
task and name that file in the Command column.

| What | Value | Command | Commit |
|------+-------+---------+--------|
| | | | |

* Notes

* Test Scenarios

Manual QA scenarios (scaffolded via =compass add test_scenario=)
that verify this task. Link
new ones here as they're created; the scenario doc itself links back
via its "Verifies task" field.

| Scenario | State | Notes |
|----------+-------+-------|
| | | |

* PRs

| PR | Title |
|----+-------|
| | |

* Review

| # | Comment summary | File | Decision | Notes |
|---+-----------------+------+----------+-------|
| | | | | |

* Result
Loading