Skip to content

plan(interactors): confidence filtering and download - #199

Open
adamjohnwright wants to merge 4 commits into
mainfrom
plan/interactor-confidence-filter
Open

plan(interactors): confidence filtering and download#199
adamjohnwright wants to merge 4 commits into
mainfrom
plan/interactor-confidence-filter

Conversation

@adamjohnwright

Copy link
Copy Markdown
Contributor

Phase 0 and 1 for specs/001-interactor-confidence-filter. Documents only — no source changes.

Five decisions, each evidenced rather than reasoned

Decision Evidence
No new data source score is already returned and already shown in interactors-table.component.ts:62; 0–1, measured 0.482–0.98 across Q13158's 33 interactions
Threshold is per resource, default 0.45 DEFAULT_SCORE and Map<String, Double> interactorsThreshold in pwp-diagram's InteractorsContent.java
Nothing is fetched the interactions are already on the graph as occurrenceNode.data('interactors')
The file is TSV molecule-download-table.component.ts is the direct analogue — a client-side export of a table from this same panel. The CSVs in this repo are all server-generated by the analysis service
The threshold lives in the URL UrlStateService's reader resets any param the URL does not mention, so a signal alone does not survive the turn

Two things planning changed rather than accepted

FileDownloadService / ManagedDownloadDirective are not reused, though my own brief suggested them. They exist for server downloads — progress, cancellation, a 180s ceiling, a failure reason off an HTTP response. This export is synchronous and in-memory, so none of those states can occur; wiring them in would add a spinner that never spins.

The consequence is recorded rather than hidden: FR-011 ("tell the curator while it is being prepared, and tell them if it fails") is close to vacuous for a synchronous export, and survives only as "must not produce a silently empty or partial file" — asserted by comparing the row count against the interactors on the diagram.

FR-007 needs no special case. "Apply the default of 0.45 but do not write it into the address" falls out of the existing mechanism: currentQueryParams() already skips any value equal to its initialValue — verified by reading it, not assumed. Declaring the param with an initial of 0.45 gets the requirement for free.

The contract is a UI contract

There is no new service API, so contracts/ui-contract.md describes what a reader and a test can address: the URL parameter, the control's addressable surface (including a [data-threshold] attribute so a test never has to inspect a slider's pixel position), and the file.

Every assertion in it counts interactors on the diagram. A slider that moved is not evidence that anything was filtered — constitution principle I.

Artifacts

  • research.md — the five decisions, with alternatives rejected
  • data-model.md — the entities, the clamping rule, and the state transitions that must hold
  • contracts/ui-contract.md — URL, control, file
  • quickstart.md — how to validate it on a running app, with the curl that re-measures the worked entity, because a figure you did not measure is not a figure

Next: /speckit-tasks.

🤖 Generated with Claude Code

Phase 0 and 1 for specs/001-interactor-confidence-filter. Five decisions,
each evidenced rather than reasoned:

  - the score is already fetched and already shown in the interactors
    table; 0-1, measured 0.482-0.98 across Q13158's 33 interactions
  - the threshold is per resource and defaults to 0.45, from
    InteractorsContent.java in pwp-diagram
  - the interactions are already on the graph, as
    occurrenceNode.data('interactors'), so nothing is fetched
  - the file is TSV, matching molecule-download-table -- the existing
    client-side export of a table from this same panel -- rather than
    the CSVs, which are all server-generated
  - the threshold lives in the URL, because the reader resets any param
    the URL does not mention

Two things the planning changed rather than accepted.

FileDownloadService and ManagedDownloadDirective are **not** reused,
though the brief suggested them. They exist for server downloads:
progress, cancellation, a ceiling, a failure reason off a response. This
export is synchronous and in-memory, so none of those states can occur
and wiring them in would add a spinner that never spins. The consequence
is recorded: FR-011 is close to vacuous here and survives only as "must
not produce a silently empty or partial file".

FR-007 -- apply the default without writing it into the address -- needs
no special case. currentQueryParams() already omits any value equal to
its initialValue, verified by reading it, so declaring the param with an
initial of 0.45 gets the requirement for free.

The contract is a UI contract, there being no new service API: the URL
parameter, the control's addressable surface, and the file. Every
assertion in it counts interactors on the diagram rather than the
control's position, because a slider that moved is not evidence that
anything was filtered.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@adamjohnwright
adamjohnwright enabled auto-merge (squash) September 14, 2026 14:16
adamjohnwright and others added 3 commits September 14, 2026 14:28
Phase 2 of Spec Kit for the interactor confidence filter and download.

Ordered so US1 alone closes the blocked checklist row: filtering the
diagram is the MVP, sharing it through the URL is US2, and the export is
US3. Each is demonstrable without the next.

Every e2e task says to run its case against main and record the failure
text before writing the code. That is unusually cheap here -- both
RELEASE-TESTING rows are "missing", so the feature genuinely does not
exist yet -- and the tasks say "recorded means pasted, not asserted",
because principle III is what stops a test describing its own fix.

The ratchets get their own note. check:dead counts an exported symbol
nothing imports, and three tasks add one each; each is imported inside
its own story, so the check belongs at the story checkpoint rather than
after every task, and the baseline is never the thing to change.

The non-code deliverables are tasks rather than an afterthought:
RELEASE-TESTING.md:117 and :118 move to auto naming the spec that
asserts them, the two matching gaps leave CURATOR-REPORT.md, and beta is
rebuilt and checked through Apache -- the dev server and beta have
disagreed before.

30 tasks, 0 malformed: 7 US1, 6 US2, 5 US3, 12 setup/foundational/polish.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant