{
  "expectations": [
    {
      "text": "Runs init_wiki.js to create directory scaffold under the project root",
      "passed": true,
      "evidence": "events.jsonl line 1 op='init' records created_dirs=[wiki, wiki/claims, wiki/synthesis, wiki/templates, raw, graph, audit/open, audit/resolved, log/daily, outputs/queries, outputs/reports, .wiki-cache] and created_files=[wiki.config.yaml, wiki/index.md, wiki/summaries.md, wiki/overview.md, .wiki-ignore, log/events.jsonl, graph/edges.jsonl, .claude/settings.json]. Scaffold is materialized on disk under with_skill/outputs/."
    },
    {
      "text": "wiki.config.yaml is created with wiki.domain: 'backend-services'",
      "passed": true,
      "evidence": "outputs/wiki.config.yaml line 3: 'domain: backend-services' under the top-level 'wiki:' block (line 1)."
    },
    {
      "text": "Directory scaffold includes wiki/, raw/, graph/, audit/, log/, outputs/",
      "passed": true,
      "evidence": "ls -d confirms all six directories exist under with_skill/outputs/ (audit, graph, log, outputs, raw, wiki)."
    },
    {
      "text": "Source file is copied to raw/ (path preserved relative to the ingested root)",
      "passed": true,
      "evidence": "outputs/raw/docs/architecture.md exists (3449 bytes) preserving the docs/ prefix from the source path 'docs/architecture.md'. events.jsonl op='ingest' records raw_copy='raw/docs/architecture.md'. File content is the full architecture.md source (sha256 251db84f...)."
    },
    {
      "text": "Generated wiki page has frontmatter with non-empty title, type set to 'concept' (or one of concept|index|synthesis|claim|template), sources listing the ingested file, created + updated ISO dates, a non-empty summary, and 4-8 content-only tags",
      "passed": true,
      "evidence": "All 5 generated pages have conforming frontmatter. e.g. wiki/authentication/jwt.md: title='JWT Access Tokens (RS256)', type=concept, tags=[jwt, rs256, authentication, asymmetric-signing, access-tokens] (5 tags), sources=[raw/docs/architecture.md], created/updated=2026-04-14, multi-line summary. overview.md type=index, claims/logout-revokes-all-tokens.md type=claim — all within the allowed enum."
    },
    {
      "text": "Tags are content-only concepts (e.g., 'jwt', 'authentication', 'session-management') — no structural/temporal/metadata tags",
      "passed": true,
      "evidence": "Aggregated tag set across all 5 pages: jwt, rs256, authentication, asymmetric-signing, access-tokens, session-management, refresh-tokens, postgresql, cookies, revocation, token-rotation, logout. All are domain concepts — no structural (e.g. 'page', 'index'), temporal ('2026', 'new'), or metadata ('draft', 'stub') tags are present."
    },
    {
      "text": "summaries.md has a non-stub entry (≥ 20 chars) for the new page",
      "passed": true,
      "evidence": "wiki/summaries.md is 2311 bytes and contains multi-sentence summaries for each of the 5 generated pages (e.g. JWT entry: 'Every authenticated API call carries a short-lived JWT in the Authorization: Bearer header...'), each well over 20 characters."
    },
    {
      "text": "Query answer includes at least two inline markdown links and each link resolves to a file that actually exists under wiki/",
      "passed": true,
      "evidence": "outputs/queries/2026-04-14-how-does-authentication-work.md contains 5 inline links: ../../wiki/authentication/jwt.md, ../../wiki/authentication/sessions.md, ../../wiki/authentication/refresh.md, ../../wiki/claims/logout-revokes-all-tokens.md, ../../wiki/authentication/overview.md. Bash [ -f ] test from the queries/ directory confirmed all 5 targets EXIST."
    },
    {
      "text": "Query answer mentions at least two concrete facts from the source (e.g., JWT, sessions table, refresh endpoint) — hallucinated answers that cite nonexistent pages must fail",
      "passed": true,
      "evidence": "Answer cites specific source facts: 'signed with RS256' (source §1), 'RSA key (2048 bits)' (§1), 'Access tokens live 15 minutes' (§1), custom 'sid' claim (§1), PostgreSQL 'sessions' table with session_id UUID, HttpOnly/Secure/SameSite=Lax cookie, '(user_id, revoked_at)' index, 'POST /auth/refresh' (§3), refresh_tokens table with token_hash/session_id/rotated_to (§3), 'revoked_at = now()' on logout (§3). All match architecture.md verbatim; no fabricated pages cited."
    },
    {
      "text": "Answer is archived to outputs/queries/ as a dated .md file",
      "passed": true,
      "evidence": "outputs/outputs/queries/2026-04-14-how-does-authentication-work.md exists (4458 bytes). Filename begins with today's ISO date 2026-04-14. events.jsonl op='query' records archive_path='outputs/queries/2026-04-14-how-does-authentication-work.md'."
    },
    {
      "text": "events.jsonl records separate entries with op='init', op='ingest', and op='query' (one per operation), all with ISO timestamps",
      "passed": true,
      "evidence": "jq over outputs/log/events.jsonl yields exactly three records: {ts:'2026-04-14T18:24:03.875000+00:00', op:'init'}, {ts:'2026-04-14T18:27:26.011000+00:00', op:'ingest'}, {ts:'2026-04-14T18:28:42.005000+00:00', op:'query'}. The hardener (op='init' now logged) holds."
    },
    {
      "text": "graph/edges.jsonl contains at least one edge with a valid provenance tag (EXTRACTED, INFERRED, or AMBIGUOUS)",
      "passed": true,
      "evidence": "outputs/graph/edges.jsonl contains 9 edges; provenance distribution from jq: 8 EXTRACTED, 1 INFERRED. All values are in the allowed set {EXTRACTED, INFERRED, AMBIGUOUS}. Example edge: {from:'wiki/authentication/jwt.md', to:'wiki/authentication/sessions.md', type:'extends', provenance:'EXTRACTED'}."
    }
  ],
  "summary": {
    "passed": 12,
    "failed": 0,
    "total": 12,
    "pass_rate": 1.0
  },
  "execution_metrics": {
    "output_chars": 28924,
    "notes": "outputs/ tree: 5 wiki pages (jwt 2768, sessions 3224, refresh 4108, overview 2990, logout claim 2120), summaries 2311, index 658, overview 513, query archive 4458, edges.jsonl 2080, events.jsonl 1185, raw copy 3449, wiki.config.yaml 3422"
  },
  "timing": {
    "total_duration_seconds": 0.0,
    "executor_duration_seconds": 0.0
  },
  "claims": [
    {
      "claim": "JWT access tokens are signed with RS256 (2048-bit RSA)",
      "type": "factual",
      "verified": true,
      "evidence": "raw/docs/architecture.md §1: 'signed with RS256 (RSA asymmetric signatures, 2048-bit key)'. Mirrored in wiki/authentication/jwt.md and the query answer."
    },
    {
      "claim": "Access-token lifetime is 15 minutes",
      "type": "factual",
      "verified": true,
      "evidence": "architecture.md §1: 'access tokens live 15 minutes'. Repeated in jwt.md, sessions.md, refresh.md, logout claim, and the query answer."
    },
    {
      "claim": "sessions table is keyed by session_id UUID and has columns user_id, created_at, last_seen_at, expires_at, user_agent, ip_address, revoked_at",
      "type": "factual",
      "verified": true,
      "evidence": "architecture.md §2 schema matches the CREATE TABLE block in wiki/authentication/sessions.md exactly."
    },
    {
      "claim": "/auth/refresh rotates the refresh token and stores hash of replacement in rotated_to",
      "type": "factual",
      "verified": true,
      "evidence": "architecture.md §3 and wiki/authentication/refresh.md both describe the rotation; refresh.md includes the SQL UPDATE mirroring the source."
    },
    {
      "claim": "graph has 9 edges, all with valid provenance",
      "type": "factual",
      "verified": true,
      "evidence": "jq count: 8 EXTRACTED + 1 INFERRED = 9 edges; all in allowed enum."
    },
    {
      "claim": "Ingest created 5 pages (overview, jwt, sessions, refresh, logout claim) and 9 edges, all grounded in a single source",
      "type": "process",
      "verified": true,
      "evidence": "events.jsonl op='ingest' records pages_created=[wiki/authentication/overview.md, wiki/authentication/jwt.md, wiki/authentication/sessions.md, wiki/authentication/refresh.md, wiki/claims/logout-revokes-all-tokens.md] and edges_written=9. Disk state matches."
    },
    {
      "claim": "op='init' is now logged (regression hardener)",
      "type": "process",
      "verified": true,
      "evidence": "events.jsonl line 1 has op='init' with ts, domain, name, created_dirs, created_files — the previously-missing entry is present in this iteration."
    },
    {
      "claim": "Query answer's citations all resolve on disk",
      "type": "quality",
      "verified": true,
      "evidence": "Bash [ -f ] from outputs/queries/ directory against each of the 5 cited relative paths returned EXISTS for all 5."
    }
  ],
  "user_notes_summary": {
    "uncertainties": [],
    "needs_review": [],
    "workarounds": []
  },
  "eval_feedback": {
    "suggestions": [
      {
        "assertion": "Generated wiki page has frontmatter with non-empty title, type set to 'concept' (or one of concept|index|synthesis|claim|template), sources listing the ingested file, created + updated ISO dates, a non-empty summary, and 4-8 content-only tags",
        "reason": "All pages have quality: 0.0 in frontmatter. This may be the default stub that lint/quality_score is supposed to replace, but no assertion forces quality to be recomputed > 0. An executor that skips quality scoring entirely would still pass. Consider asserting quality > 0 (or that a quality_score step was invoked)."
      },
      {
        "assertion": "events.jsonl records separate entries with op='init', op='ingest', and op='query' (one per operation), all with ISO timestamps",
        "reason": "The ingest event records total_tokens_in=0, total_tokens_out=0, total_cost_usd=0 and agent_calls=[]. Either the harness didn't make LLM calls (unlikely given 5 rich pages were synthesized) or token accounting isn't wired through. No assertion catches this silent instrumentation gap."
      },
      {
        "reason": "No assertion checks that the 'How to Go Deeper' footer (live/raw/db shortcuts) is present and its raw-source link resolves. The recent G-ORM-DEEPER commit added this convention; without an assertion, regressions would go unnoticed."
      },
      {
        "reason": "No assertion verifies that the source file copied into raw/ byte-for-byte matches the ingested input. A silent truncation or re-encoding could pass today (the current check only asks that it be 'copied'). sha256 parity against the input would be stronger."
      }
    ],
    "overall": "All 12 tightened assertions pass cleanly with substantive evidence — the output is genuinely high-quality (grounded facts, resolving citations, proper provenance), not coincidentally compliant. The hardeners (op=init present, citations resolve, concrete facts cited, valid provenance) all hold. Remaining gaps are around token-accounting instrumentation and raw-copy byte parity, not around the core behaviors under test."
  }
}
