kb-qa — post-publish / pre-save QA report
Run broad QA over the published vault or a pre-save candidate: coverage, evidence spot-checks, formula
screenshot spot-checks, concept pollution, an ljg-qa-style Q-chain. Produces a report and Review-Queue
proposals only; it does not edit content pages.
1. Triggers / Non-triggers
- Triggers: "run a KB QA", "audit coverage", "spot-check evidence", "run the Q-chain", "check for concept pollution", "pre-save QA".
- Non-triggers: "semantic health check", "find contradictions", "does the comparison cover the key dimensions", "Q2 added value" belong to
wiki-lint-semantic; handling an existing Review-Queue uses kb-review; read-only Q&A uses kb-query; a new source uses ingest. kb-qa and wiki-lint-semantic are mutually exclusive on triggers.
2. Inputs
- Scope: whole vault, a domain, a source, a query-session, or a proposed write candidate.
- Read:
wiki/index.generated.md, wiki/concepts/_registry.yaml, and the relevant source/concept/topic/comparison/synthesis/lesson pages.
- May read:
pipeline-workspace/query-sessions/<run_id>/, wiki/Review-Queue/, the deterministic lint result.
3. Outputs
pipeline-workspace/reports/kb-qa/<run_id>.md: the QA report.
- For actionable findings, write
wiki/Review-Queue/kb-qa-<YYYY-MM-DD>.md proposals; no direct content-page edits.
- The report covers scope, the Q-chain, sampled items, findings, risk level, and the suggested follow-up skill (usually
kb-review).
- For an actionable finding on an
adopted/published legacy page, distinguish the later
revise-adopted write authorization from content attribution: record official evidence for the
finding, but do not add a book to source_refs or claim that the legacy page has acquired a source.
4. Dependencies
- CLI:
python scripts/pipeline.py status; if needed python scripts/pipeline.py lint --source <source_id>.
revise-adopted belongs to the confirmed-fix path in kb-review, never to this read-only QA run.
- Protocols:
docs/skill-runtime/schema.md, save-back-policy.md, concept-resolution.md.
- Triggers mutually exclusive with
wiki-lint-semantic: semantic-health words are not handled here.
5. Persisted artifacts
pipeline-workspace/reports/kb-qa/<run_id>.md.
wiki/Review-Queue/kb-qa-<YYYY-MM-DD>.md (only when an actionable finding exists).
- The spot-check list: sampled pages, evidence refs, and Q-chain conclusions recorded in the report.
6. CLI commands
python scripts/pipeline.py status
python scripts/pipeline.py lint --source <source_id>
This skill never promotes, rolls back, or edits content pages; fixes go to kb-review or the matching write skill.
If the finding targets an adopted legacy page, the handoff must say that revise-adopted can authorize
the later edit but cannot validate the evidence or change source_refs.
7. Workflow
| Sub-unit |
Input |
Output |
Acceptance |
Persisted |
Failure stop |
| QA1 scope |
request + index |
scope and samples |
does not hijack wiki-lint-semantic triggers |
report draft |
scope unclear |
| QA2 status background |
source/status/lint |
deterministic background |
does not re-implement deterministic lint |
report |
lint already blocked |
| QA3 Q-chain |
in-scope material |
question→evidence→judgement→action |
every Q has an evidence path |
report |
evidence thin |
| QA4 spot-check |
page/formula/evidence samples |
spot-check results |
samples and conclusions traceable |
report |
sample missing |
| QA5 file findings |
actionable findings |
Review-Queue proposal |
no content-page edits |
kb-qa proposal |
duplicate proposal |
Evidence discipline (two rules that cost real rework when broken)
A "not in the source" verdict requires an exhaustive search, and the search must be shown. Before
writing that a term/number/mechanism is absent, search the source for the Chinese rendering, the English
name, the abbreviation, and case/hyphen variants — then record every search term in the finding. A
single-language search is the documented way this goes wrong: an audit once declared a bilingual term
"not mentioned" after searching only its English form, while the book used the Chinese form several
times. The cost is asymmetric — a missed finding leaves one clause unfixed, but a false finding
triggers a rewrite of a correct page, and every rewrite is a fresh chance to introduce an error.
Normalize five PDF extraction deformations before you conclude a term is absent. A page's word can be
verbatim in the source yet fail a naive string search because the extracted source.md mangled it. One
audit hit the first three at once (20 false "not in source" candidates),
then the full page-by-page read surfaced two more — each of which, if believed, would have rewritten a
correct page. Apply all five before the search, not after:
- Ligatures — the PDF stores
ffi/ff/fi/fl (single code points, e.g. U+FB03) so Efficiency is
Efficiency, Parameter-Efficient is Parameter-Efficient. Expand ligatures to their ASCII letters.
- Line-break hyphenation — a word split across a line break keeps its hyphen:
Accurately becomes
Ac-⏎curately, Prefixes becomes Pre-⏎fixes. Rejoin -⏎ before searching.
- CJK–Latin spacing — the extractor inserts a space between CJK and Latin runs, so
Encoder-only架构
is stored as Encoder-only 架构. Collapse all whitespace (this also covers the plain
Chinese/English/abbreviation/case/hyphen variants above).
- Thousands separator — the page writes
1000 but the source prints the grouped form 1,000
(ROME's "1000 条知识" is 1,000 in the source). Strip , from digit runs before matching numbers.
- Chinese numerals — the page writes an Arabic digit but the source uses the Chinese numeral
(T5's "连续 3 个" is
连续三个 in the source). Try the 一/二/三… form of any small integer.
Record the normalized form you searched, not just the raw term.
A sampling PASS is not a clean bill for the page. When you spot-check assertions rather than reading
the page whole, the verdict covers only the assertions actually sampled — say so in the report, and
later rounds must never inherit it as evidence that the page is clean. Three consecutive rounds on
one source overturned pages that an earlier sampling round had marked clean; only an integral,
per-assertion pass supports a page-level conclusion.
8. Failure stops / recovery
vault/index missing; scope unclear; the request is really a semantic-health check (switch to
wiki-lint-semantic); deterministic lint already failed with no stable QA scope; an evidence path is
missing; the user asks to edit content pages directly (switch to kb-review and wait for confirmation);
an adopted-page finding has no official evidence strong enough to support the proposed correction.
Recovery: the report + proposals are the durable output; re-run after the scope is clarified.
9. Acceptance criteria
- The QA report is written under
pipeline-workspace/reports/kb-qa/.
- Every Q-chain item has a question, evidence, judgement, and a follow-up action.
- Actionable findings are written as Review-Queue proposals.
- Adopted legacy findings separate “evidence supports this correction” from “the pipeline authorizes a
later write”; no new
source_refs are inferred from a citation or from revise-adopted.
- No wiki content page was edited directly.
- None of
wiki-lint-semantic's exclusive triggers were handled.
1---2name: kb-qa3description: Run QA / audit / coverage checks on the published knowledge base or pre-save candidates, producing a report and Review-Queue proposals. Use when the user says "run a KB QA / audit coverage / spot-check evidence / run the Q-chain / check for concept pollution". Semantic-health words (L4, contradiction, Q2 added value) belong to wiki-lint-semantic and must not be hijacked here.4---56# kb-qa — post-publish / pre-save QA report78Run broad QA over the published vault or a pre-save candidate: coverage, evidence spot-checks, formula9screenshot spot-checks, concept pollution, an ljg-qa-style Q-chain. Produces a report and Review-Queue10proposals only; it does not edit content pages.1112## 1. Triggers / Non-triggers1314- **Triggers:** "run a KB QA", "audit coverage", "spot-check evidence", "run the Q-chain", "check for concept pollution", "pre-save QA".15- **Non-triggers:** "semantic health check", "find contradictions", "does the comparison cover the key dimensions", "Q2 added value" belong to `wiki-lint-semantic`; handling an existing Review-Queue uses `kb-review`; read-only Q&A uses `kb-query`; a new source uses `ingest`. kb-qa and `wiki-lint-semantic` are **mutually exclusive** on triggers.1617## 2. Inputs1819- Scope: whole vault, a domain, a source, a query-session, or a proposed write candidate.20- Read: `wiki/index.generated.md`, `wiki/concepts/_registry.yaml`, and the relevant source/concept/topic/comparison/synthesis/lesson pages.21- May read: `pipeline-workspace/query-sessions/<run_id>/`, `wiki/Review-Queue/`, the deterministic `lint` result.2223## 3. Outputs2425- `pipeline-workspace/reports/kb-qa/<run_id>.md`: the QA report.26- For actionable findings, write `wiki/Review-Queue/kb-qa-<YYYY-MM-DD>.md` proposals; no direct content-page edits.27- The report covers scope, the Q-chain, sampled items, findings, risk level, and the suggested follow-up skill (usually `kb-review`).28- For an actionable finding on an `adopted/published` legacy page, distinguish the later29 `revise-adopted` **write authorization** from content attribution: record official evidence for the30 finding, but do not add a book to `source_refs` or claim that the legacy page has acquired a source.3132## 4. Dependencies3334- CLI: `python scripts/pipeline.py status`; if needed `python scripts/pipeline.py lint --source <source_id>`.35 `revise-adopted` belongs to the confirmed-fix path in `kb-review`, never to this read-only QA run.36- Protocols: `docs/skill-runtime/schema.md`, `save-back-policy.md`, `concept-resolution.md`.37- Triggers mutually exclusive with `wiki-lint-semantic`: semantic-health words are not handled here.3839## 5. Persisted artifacts4041- `pipeline-workspace/reports/kb-qa/<run_id>.md`.42- `wiki/Review-Queue/kb-qa-<YYYY-MM-DD>.md` (only when an actionable finding exists).43- The spot-check list: sampled pages, evidence refs, and Q-chain conclusions recorded in the report.4445## 6. CLI commands4647```text48python scripts/pipeline.py status49python scripts/pipeline.py lint --source <source_id>50```5152This skill never promotes, rolls back, or edits content pages; fixes go to `kb-review` or the matching write skill.53If the finding targets an adopted legacy page, the handoff must say that `revise-adopted` can authorize54the later edit but cannot validate the evidence or change `source_refs`.5556## 7. Workflow5758| Sub-unit | Input | Output | Acceptance | Persisted | Failure stop |59|---|---|---|---|---|---|60| QA1 scope | request + index | scope and samples | does not hijack wiki-lint-semantic triggers | report draft | scope unclear |61| QA2 status background | source/status/lint | deterministic background | does not re-implement deterministic lint | report | lint already blocked |62| QA3 Q-chain | in-scope material | question→evidence→judgement→action | every Q has an evidence path | report | evidence thin |63| QA4 spot-check | page/formula/evidence samples | spot-check results | samples and conclusions traceable | report | sample missing |64| QA5 file findings | actionable findings | Review-Queue proposal | no content-page edits | kb-qa proposal | duplicate proposal |6566### Evidence discipline (two rules that cost real rework when broken)6768**A "not in the source" verdict requires an exhaustive search, and the search must be shown.** Before69writing that a term/number/mechanism is absent, search the source for the Chinese rendering, the English70name, the abbreviation, and case/hyphen variants — then **record every search term** in the finding. A71`single-language search` is the documented way this goes wrong: an audit once declared a bilingual term72"not mentioned" after searching only its English form, while the book used the Chinese form several73times. The cost is asymmetric — a missed finding leaves one clause unfixed, but a **false** finding74triggers a rewrite of a correct page, and every rewrite is a fresh chance to introduce an error.7576**Normalize five PDF extraction deformations before you conclude a term is absent.** A page's word can be77verbatim in the source yet fail a naive string search because the extracted `source.md` mangled it. One78audit hit the first three at once (**20 false "not in source" candidates**),79then the full page-by-page read surfaced two more — each of which, if believed, would have rewritten a80correct page. Apply all five before the search, not after:81821. **Ligatures** — the PDF stores `ffi`/`ff`/`fi`/`fl` (single code points, e.g. U+FB03) so `Efficiency` is83 `Efficiency`, `Parameter-Efficient` is `Parameter-Efficient`. Expand ligatures to their ASCII letters.842. **Line-break hyphenation** — a word split across a line break keeps its hyphen: `Accurately` becomes85 `Ac-`⏎`curately`, `Prefixes` becomes `Pre-`⏎`fixes`. Rejoin `-`⏎ before searching.863. **CJK–Latin spacing** — the extractor inserts a space between CJK and Latin runs, so `Encoder-only架构`87 is stored as `Encoder-only 架构`. Collapse all whitespace (this also covers the plain88 Chinese/English/abbreviation/case/hyphen variants above).894. **Thousands separator** — the page writes `1000` but the source prints the grouped form `1,000`90 (ROME's "1000 条知识" is `1,000` in the source). Strip `,` from digit runs before matching numbers.915. **Chinese numerals** — the page writes an Arabic digit but the source uses the Chinese numeral92 (T5's "连续 3 个" is `连续三个` in the source). Try the 一/二/三… form of any small integer.9394Record the normalized form you searched, not just the raw term.9596**A sampling PASS is not a clean bill for the page.** When you spot-check assertions rather than reading97the page whole, the verdict covers **only the assertions actually sampled** — say so in the report, and98later rounds must **never inherit** it as evidence that the page is clean. Three consecutive rounds on99one source overturned pages that an earlier sampling round had marked clean; only an integral,100per-assertion pass supports a page-level conclusion.101102## 8. Failure stops / recovery103104vault/index missing; scope unclear; the request is really a semantic-health check (switch to105`wiki-lint-semantic`); deterministic lint already failed with no stable QA scope; an evidence path is106missing; the user asks to edit content pages directly (switch to `kb-review` and wait for confirmation);107an adopted-page finding has no official evidence strong enough to support the proposed correction.108**Recovery:** the report + proposals are the durable output; re-run after the scope is clarified.109110## 9. Acceptance criteria111112- The QA report is written under `pipeline-workspace/reports/kb-qa/`.113- Every Q-chain item has a question, evidence, judgement, and a follow-up action.114- Actionable findings are written as Review-Queue proposals.115- Adopted legacy findings separate “evidence supports this correction” from “the pipeline authorizes a116 later write”; no new `source_refs` are inferred from a citation or from `revise-adopted`.117- No wiki content page was edited directly.118- None of `wiki-lint-semantic`'s exclusive triggers were handled.