ConfidenceComputer, and mark_page_verifiedVerification metadata (verified_at, verified_by, and effective confidence) is the trust contract that tells both human engineers and downstream AI agents whether a wiki page has been rigorously checked against primary sources. In Wikantik, verification is never a mechanical rubber-stamp: a page is stamped with mark_page_verified only after passing four mandatory verification gates (Factual Grounding, Structural/Schema Lint, KaTeX/Mermaid Integrity, and Live assemble_bundle Retrieval Verification).
flowchart LR
subgraph Gate1["Gate 1: Source-of-Truth Fact Check"]
Read["Read Page End-to-End"]
CodeCheck["Codebase Claims:<br/>Grep wikantik.properties,<br/>McpProtocolIT, web.xml, git log"]
WebCheck["Domain Claims:<br/>Verify equations, versions,<br/>benchmarks & escape currency (\$)"]
Read --> CodeCheck & WebCheck
end
subgraph Gate2["Gate 2: Structural & Schema Gate"]
VP["Call verify_pages(slugs=[...])<br/>0 brokenLinks · 0 missingMetadata<br/>0 seoWarnings · 120-155c summary"]
CodeCheck & WebCheck --> VP
end
subgraph Gate3["Gate 3: Live Retrieval Gate"]
Bundle["Call assemble_bundle(query=...)<br/>Target page ranks in Top 3<br/>with strong coverage"]
VP --> Bundle
end
subgraph Gate4["Gate 4: Stamp & Confidence Resolution"]
Stamp["Call mark_page_verified(<br/>slugs=[...], verifier='jakefear')"]
Comp["ConfidenceComputer:<br/>trusted_authors + 90d window<br/>-> confidence = authoritative"]
Bundle --> Stamp --> Comp
end
ConfidenceComputer Calculates Effective Page ConfidenceWhen mark_page_verified writes verified_at = NOW() and verified_by = <verifier> into a page's YAML frontmatter, the post-save structural spine listener syncs those fields into the PostgreSQL page_verification table. At read time (get_page_for_agent, assemble_bundle, and /admin/verification), ConfidenceComputer evaluates the effective confidence tier using a deterministic precedence rule over the staleness window W_{\text{stale}} (configured by wikantik.verification.stale_days, default 90 days) and the trusted_authors table:
Critical Distinction (
trusted_authorsTable vs.wikantik.frontmatter.trustedAuthorsProperty):
- The PostgreSQL
trusted_authorstable (keyed bylogin_name) is whatConfidenceComputerreads to grantauthoritativestatus.- The
wikantik.frontmatter.trustedAuthorsproperty only controls whether saving a page emits an advisoryverified_by.untrustedlint warning—it never elevatesprovisionaltoauthoritative.- If you omit
verifier(orverifiedBy) when callingmark_page_verified, the server defaults to the MCP client'sclientInfo.name(e.g.,claude-codeorwikantik-cli), which is not intrusted_authorsand therefore yieldsprovisional. Always pass the trusted human login explicitly when executing an authorized verification pass.
Before calling mark_page_verified, verify all four gates:
| Gate | Verification Command / Tool | Pass Criteria |
|---|---|---|
| 1. Factual & Codebase Grounding | grep -rn, CHANGELOG.md, web search (see Non-Existent Function Runbook) | Every cited Java class, config property, MCP tool name, CLI flag, or external benchmark is confirmed to exist. |
| 2. Frontmatter, Link & Math Integrity | verify_pages(slugs=[...], checks=["broken_links", "metadata_completeness", "seo_readiness", "heading_structure"]) | totalBrokenLinks: 0, missingMetadata: [], seoWarnings: [], summary is 120–155 chars, all currency is escaped (\$100), display math $$ delimiters sit on dedicated lines, and **Cluster Hub:** link is present. |
| 3. Visual & Structural Depth | ./bin/wikantik inspect <Slug> and ./bin/wikantik lint <Slug> | Deep-dive articles contain 1,200–2,500+ words (Hubs: 500–800+ words), at least one mermaid diagram, comparative Markdown tables, and topic-specific ## headings. |
4. Live assemble_bundle Retrieval Rank | ./bin/wikantik test-retrieval --slug <Slug> "<target query>" or assemble_bundle | The page's primary sections surface in the top results with coverage.confidence = "strong". |
verify_pages on /wikantik-admin-mcp{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "verify_pages",
"arguments": {
"slugs": ["WikantikSearchAndRetrieval", "PageGraphVsKnowledgeGraph"],
"checks": [
"broken_links",
"metadata_completeness",
"seo_readiness",
"heading_structure"
]
}
}
}
mark_page_verified on /wikantik-admin-mcp{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "mark_page_verified",
"arguments": {
"slugs": ["WikantikSearchAndRetrieval", "PageGraphVsKnowledgeGraph"],
"verifier": "jakefear"
}
}
}
Note on System Pages: System pages such as
AboutorMainrefusemark_page_verifiedstamps over MCP ("system page — refusing to stamp via MCP"). That is expected behavior enforced bySystemPageRegistry.
mark_page_verified without reading and checking each page. Poisoning the authoritative signal destroys agent trust across the entire cluster.pageNames Instead of slugs: Both verify_pages and mark_page_verified require the JSON property "slugs": [...]. Passing "pageNames" or "pages" fails JSON schema validation.confidence: stale: Only pin confidence: stale when a trusted reviewer has confirmed a page contains outdated claims that cannot be fixed immediately—never use it to mean "unreviewed".Cluster Hub: Agent Cookbook (agent-cookbook)