Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013BnEiXtnFyDonxp2LTfvjf
Plan (#1587)1. The groom re-run on today's
|
| criterion | item-full gate | item-full QA | child gate | child QA |
|---|---|---|---|---|
| priority_present | ✗ | ✗ | ✗ | ✗ |
| has_field priority | ✗ | ✗ | ✗ | ✗ |
| has_field status | ✗ | ✗ | ✗ | ✗ |
| has_field assignee | ✗ (holds) | ✗ (holds) | fails, correct (none) | fails, correct |
| has_field effort | ok | ok | ok | ok |
| has_field tags | ✗ | ✗ | ✗ | ✗ |
| has_any_field [priority, assignee] | ✗ | ✗ Δ (QA not run in the groom) | ✗ | ✗ Δ |
| has_tags | ✗ | ok | ✗ | ok |
| has_outlinks | ✗ | ok | ✗ | ok |
| status_present, descriptive_title | ok | ok | ok | ok |
| not_oversized | ok (S) | ok | ok | ✗ "consider decomposing" |
| orphan_backlog_item | fails, correct (no subtask_of) | fails, correct | ok | ✗ "no parent epic" |
| body_has_section / _pattern / _code_block | correct | correct | correct | correct |
The whole-KB sweep gives the same findings as --entry for both items Δ (the groom assumed this and did not run it). Every other cell matches the groom. Nothing in the groom is wrong on today's dev; #1553, #1585, #1611 and #1480 changed none of these paths.
2. Every place that calls a checker or builds its entry
Found with grep -rn "rubric_checkers|get_rubric_checkers|get_all_rubric_checkers|gate_checker|NAMED_CHECKERS|_DRY_RUN_ENTRY|_tag_count|_outlink_count|_links" over pyrite/ and extensions/*/src.
| # | place | what it does | class |
|---|---|---|---|
| 1 | plugin.py _evaluate_gate |
builds the gate's entry (dict(row) + meta + _links) |
fixed here: calls the builder once, outside evaluating. Guarded by test_a_checker_gives_the_files_verdict[gate-*] and by a new cell in test_gate_lookup_failure_keeps_its_error.py |
| 2-6 | _mcp_check_ready, _mcp_refine, _mcp_claim, _mcp_transition, _mcp_review |
SELECT * the row and hand it to _evaluate_gate; they build no entry |
guarded: test_every_gate_tool_gives_the_files_verdict[tool], parametrised from GATE_OF_TOOL (so a sixth tool needs a cell). Their bodies are not reshaped |
| 7 | board.py check_criterion dry run (_DRY_RUN_ENTRY) |
the load-time entry | fixed here: it becomes the builder's empty_checker_entry(). Guarded by the structural test, plus a DEFAULT_BOARD_CONFIG control cell |
| 8 | qa_service.py _check_rubric_evaluation |
builds QA's entry (_tag_count, _outlink_count; no _links, narrow columns) |
fixed here: calls the builder. Guarded by the qa-entry and qa-kb cells |
| 9 | qa_service.py validate_entry SELECT |
narrow columns | fixed here: SELECT * (see 4) |
| 10 | qa_service.py _check_named_rubric_all SELECT |
narrow columns | fixed here: SELECT * |
| 11 | registry.get_all_rubric_checkers |
returns the functions; calls none | safe by reading |
| 12 | cli/qa_commands.py _show_all_checkers, _show_kb_coverage |
list names and docstrings; call none | safe by reading |
| 13 | plugin rubric checkers (get_rubric_checkers) |
run only in QA (8), so they get the built entry | safe by reading: the same call site as 8; no shipped plugin has one |
| 14 | no_open_blockers |
its own lookup (#1585) | out of scope |
| 15 | QA tier-2 model rubric (_collect_judgment_items, _evaluate_llm_rubric) |
skips every item with a checker |
safe by reading: no named checker runs there |
| 16 | QA surfaces: CLI qa validate and ci, MCP kb_qa_validate, REST qa.py/admin.py |
all go through QAService |
safe by reading: the same service as 8 |
test_no_caller_builds_a_checker_entry_itself (an AST scan of pyrite/ and extensions/*/src) fails if any module other than pyrite/services/checker_entry.py writes _tag_count, _outlink_count or _links into a dict, or defines a literal dict carrying them.
3. The builder
pyrite/services/checker_entry.py (new):
checker_entry(db, row) -> dict.rowis a fullentryrow (SELECT *; a mapping or asqlite3.Row). It reads:- the row's columns, copied as they are (
title,bodyandstatusstay where the checkers read them today); metadata: the parsed bag (a new dict, never the stored one), with each field column filled in where the bag has no non-empty value. The field columns aredate importance status location assignee assigned_at priority due_date start_date end_date coordinates fips state lifecycle, plustitleandsummary. A test pins this list against theentrytable's columns, so a new column needs a decision;tags: the tag names fromentry_tag JOIN tag, put intometadata["tags"]when there are any._tag_countis their number;_links:[{target, relation}]fromlink(the gate's shape today)._outlink_countislen(_links), the rows QA counts today.- Two queries through
db.execute_sql. QA's twoCOUNT(*)become these two, so QA runs no extra query per entry.
- the row's columns, copied as they are (
empty_checker_entry() -> dict: the shape with no row, used by the dry run.- Projection order: the bag's value first, the column where the bag has none. That is the reverse of
declared_over_bag. For a kb.yamlprotocols:type, the bag holds the file's value as written and the column holds a lossy copy (location: [Paris, Lyon]becomes"Paris, Lyon"). For a plugin class there is no bag copy, so the column is the only reading. Truthiness is the same either way, so both kinds give one answer. This is in "Unsure".
4. QA's SELECTs
Both widen to SELECT * FROM entry WHERE .... _check_entry_fields and _validation_fields also read entry in validate_entry. _validation_fields copies every non-None row key into the fields it validates and then overrides _TYPED_COLUMNS from the file source, so the extra columns could change schema findings. To keep schema validation byte-identical, validate_entry keeps its narrow SELECT for those checks, and _check_rubric_evaluation gets the full row: one SELECT * by id, run only when the type has a rubric. The sweep's _check_named_rubric_all feeds only the rubric, so it simply widens to SELECT *. If a test shows the narrow row is not needed in validate_entry, I'll use one SELECT * there instead and say so.
5. Files, against the groom's Touches line
The groom's 8, and no others: pyrite/services/checker_entry.py (new), pyrite/services/qa_service.py (_check_rubric_evaluation and the two SELECTs only), plugin.py (_evaluate_gate only), board.py (_DRY_RUN_ENTRY only), kb/components/rubric-checkers.md, docs/plugins.md, tests/test_a_checker_sees_the_items_own_fields.py (new), and the changelog fragment. Also tests/test_gate_lookup_failure_keeps_its_error.py (a cell, as the brief asks) and the backlog item.
6. Findings, for the maintainer to read twice
- A column can hold the model's default, not something the file wrote. A
backlog_itemwith nopriorityin its file haspriority = "medium"in its column (andstatus = "proposed"; ataskgetspriority = 5).pyrite getshows the samepriority: medium. After this change,priority_presentandhas_field prioritytherefore hold for every backlog item in a gate, asstatus_presentalready does today forstatus. Ondev, these checkers fail for every backlog item, those with a priority included. I read this as the item's verdict as Pyrite reads it (the same answer asget), not as a checker-logic or index change, so it is not a stop. If you read "the file's verdict" as "only what the file wrote", that answer can come only from a storage change (the index would have to record which fields the file wrote), which is on the stop list. The test states it with a control cell. has_fieldwill seetags,titleandsummary. It will not seealiases,sourcesorlinks(the link checkers read_links). Truthiness is unchanged (priority: 0is missing). All of this goes inkb/components/rubric-checkers.md._evaluate_gatekeeps itsmetaparameter so the five callers keep their shape, but no longer reads it: the builder parses the row's ownmetadata, which is what every caller passed.
7. Tests (red first)
tests/test_a_checker_sees_the_items_own_fields.py runs on a real KB (tests/_world.py), with real index sync, the real MCP sw_check_ready and the other gate tools, and the real QAService. Expected verdicts are written by hand. A whole-KB qa validate timing on a 2,000-entry throwaway KB, before and after, goes in the report.
Generated by Claude Code
|
Conductor answer to the plan on #1660 (#1587), 2026-11-17. Go ahead as planned. No stop.
|
Fixes #1587
Branch: this session was given its own branch name,
claude/gate-checker-property-failures-ddtum2, which is used here instead offix/1587-a-checker-sees-the-items-own-fields.The plan is in the first comment below. The report will be appended here under "## Report".
Theme block (from the groom, 2026-11-17)
Generated by Claude Code