Repository navigation
OKF-11 - #12
OKF-11#12
Conversation
Plan-Finalized: 53f1486f30f003fa1e8d5962f18e5c55c0ec595408ef820b612b659b7ae906bd
Overdeck-Agent: agent-okf-11
tests/conftest.py puts the repo scripts/ directory on sys.path and provides the scripts_dir and fixture_bundle fixtures. CI now installs pytest and runs `python -m pytest -q tests` after scripts/selftest.sh. Item: pytest-harness Item: pytest-harness.ac1 Item: pytest-harness.ac2 Item: pytest-harness.ac3 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Overdeck-Agent: agent-okf-11
Overdeck-Agent: agent-okf-11
Overdeck-Agent: agent-okf-11
render_markdown renders the supported Markdown subset (headings with slug ids, paragraphs, fenced code, blockquotes, nested lists, thematic breaks, pipe tables, footnotes, inline code, links, images as alt text, autolinks, emphasis) with every text run HTML-escaped. Raw HTML stays escaped text, and every emitted href is re-checked so only relative, http, https and mailto hrefs survive. Underscore emphasis needs non-word boundaries so identifiers like x_visibility_default stay intact. Item: markdown-renderer Item: markdown-renderer.ac1 Item: markdown-renderer.ac2 Item: markdown-renderer.ac3 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Overdeck-Agent: agent-okf-11
The renderer commit's tests cover headings, nested lists, blockquote, fenced python and pipe table (ac4) and the full test file (ac5). Item: markdown-renderer.ac4 Item: markdown-renderer.ac5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Overdeck-Agent: agent-okf-11
Overdeck-Agent: agent-okf-11
Overdeck-Agent: agent-okf-11
…nd scan publish_redact.py defines the eight built-in rules, loads and strictly validates okf-publish.yaml (version, unknown keys, disabled ids, rule ids, duplicate ids, regex compile errors, private strings), applies rules in order with literal replacements, and scans text for rule ids and line numbers without returning matched text. templates/okf-publish.yaml is the starter profile; a test keeps its listed built-in ids equal to DEFAULT_RULES. Item: redaction-rules Item: redaction-rules.ac1 Item: redaction-rules.ac2 Item: redaction-rules.ac3 Item: redaction-rules.ac4 Item: redaction-rules.ac5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Overdeck-Agent: agent-okf-11
Overdeck-Agent: agent-okf-11
Overdeck-Agent: agent-okf-11
publish_model.py walks bundle Markdown (skipping dot-components, node_modules and the --out directory), resolves visibility from x_visibility and the schema.md x_visibility_default (private when absent; invalid values are P_VISIBILITY_INVALID), derives the trust tier from verified entries, normalises tags and sources, classifies link targets, and computes public directories and public-only backlinks. Unparseable frontmatter is P_FRONTMATTER_PARSE. The model also records index_offsets (frontmatter lines stripped from each index.md) so --check can report true file line numbers for the root index. tests/fixtures/publish_bundle is the shared fixture: three public concepts, two private ones holding home paths, an IP and a private string, a log.md, a profile, and a dot-directory file. Item: publish-model Item: publish-model.ac1 Item: publish-model.ac2 Item: publish-model.ac3 Item: publish-model.ac4 Item: publish-model.ac5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Overdeck-Agent: agent-okf-11
Overdeck-Agent: agent-okf-11
Overdeck-Agent: agent-okf-11
publish_render.py writes one page per public concept (ID, title, type, status and trust badges, tags, description, body, sources, public-only backlinks) and one index page per published directory, inside a fixed page shell that uses only page-relative hrefs. Index listing lines for private concepts and unpublished directories are dropped; a directory without index.md gets a generated listing. Links to private, missing or non-Markdown targets render as their text. Two details beyond the PRD text: the OKF index marker comments are removed before rendering so they do not show as escaped text, and filtering is built on kept_index_lines so --check can map filtered index text back to file line numbers. Item: site-pages Item: site-pages.ac1 Item: site-pages.ac2 Item: site-pages.ac3 Item: site-pages.ac4 Item: site-pages.ac5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Overdeck-Agent: agent-okf-11
Overdeck-Agent: agent-okf-11
Overdeck-Agent: agent-okf-11
publish_search.py writes search-index.json (one record per public concept, link targets and footnote markers stripped from the text), search.html with the single search.js script tag, and copies publish_assets/search.js. The script reads q, fetches the JSON index, requires every term, scores title/description/text matches, and builds results with createElement, textContent and setAttribute only. scripts/publish_render.py is also touched: its private _write helper is renamed write_file because publish_search.py now shares it. Browser check (ac4): served the published fixture with python3 -m http.server and loaded search.html?q=spoilers in headless Chrome with an isolated profile. The results list showed "No spoilers" and "Old spoiler rule" (2 result(s)) and the DOM held no ZZ-PRIVATE text. Item: search-index Item: search-index.ac1 Item: search-index.ac2 Item: search-index.ac3 Item: search-index.ac4 Item: search-index.ac5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Overdeck-Agent: agent-okf-11
Overdeck-Agent: agent-okf-11
Overdeck-Agent: agent-okf-11
…uilds publish.py loads the profile, builds the model (excluding --out when it lies inside the bundle), refuses rule matches in public concept IDs or published directory paths (P_ID_REDACTION), and refuses an unsafe --out (P_OUT_UNSAFE: the bundle or an ancestor, a file, or a non-empty directory without the .okf-publish marker). With no findings it clears a marked --out, writes the marker, redacts every published string and filtered index text, and renders pages, search and assets. Any finding exits 2 before anything is written. The --out/--check group is in place; --check itself is filled in by the publish-check-mode item and stops with an argparse error until then. Item: publish-command Item: publish-command.ac1 Item: publish-command.ac2 Item: publish-command.ac3 Item: publish-command.ac4 Item: publish-command.ac5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Overdeck-Agent: agent-okf-11
Overdeck-Agent: agent-okf-11
Overdeck-Agent: agent-okf-11
--check scans the published text of public concepts (title, description, type, status, tags, source fields and body) and of published index pages. Each matching rule is one P_REDACTION finding naming the rule id and the file line (body and index) or field name (frontmatter); the matched text is never printed. It exits 2 on any finding, 0 otherwise, and writes nothing. Index line numbers map through the kept listing lines and the stripped frontmatter offset, so they match the index.md file even when private listing lines are dropped or the root index carries frontmatter. Item: publish-check-mode Item: publish-check-mode.ac1 Item: publish-check-mode.ac2 Item: publish-check-mode.ac3 Item: publish-check-mode.ac4 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Overdeck-Agent: agent-okf-11
Overdeck-Agent: agent-okf-11
Overdeck-Agent: agent-okf-11
…test entry SKILL.md and README.md command tables gain the same /okf publish row (the selftest drift check compares them), SKILL.md gains the /okf publish section, and the selftest command loop now requires it. Item: skill-command-row Item: skill-command-row.ac1 Item: skill-command-row.ac2 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Overdeck-Agent: agent-okf-11
Overdeck-Agent: agent-okf-11
Overdeck-Agent: agent-okf-11
…nd USAGE README gains a "Publishing a bundle" section: what the site is, visibility (x_visibility, x_visibility_default, private by default, private links render as text), the okf-publish.yaml redaction profile and built-in rule ids, --check as the CI gate, a sample Cloudflare Pages workflow, and notes for GitHub Pages and local preview. references/publish.md is the full reference: synopsis, visibility, link and trust-tier rules, profile schema and built-in rules (with the ipv4 false-positive note), output layout, --out safety and rebuilds, all seven P_* finding codes with exit codes, and what is never published. docs/USAGE.md gains the /okf publish section. Item: publishing-docs Item: publishing-docs.ac1 Item: publishing-docs.ac2 Item: publishing-docs.ac3 Item: publishing-docs.ac4 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Overdeck-Agent: agent-okf-11
Overdeck-Agent: agent-okf-11
search_records wrote the raw concept page path as the record url, and search.js puts it straight into href. A concept file named c#.md gave a dead search link, and a root file named javascript:x.md gave a javascript: href, which NFR-4 forbids. Record urls now go through relative_href from search.html, which quotes each path segment. For the fixture the urls are unchanged. This deviates from the literal PRD section 4.7 text (url = concept_page_path(id)) to keep NFR-4. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Overdeck-Agent: agent-okf-11
A private string such as "Alice Example" wrapped as "Alice\nExample"
in a body slipped past both --check and --out redaction, because the
rule was re.escape(s). The browser then showed it as "Alice Example",
and search_text collapsed the whitespace, so the name also landed
verbatim in search-index.json. Each private string now compiles to its
escaped words joined by \s+, case-insensitive, so any whitespace run
between words matches. A whitespace-only private string is now an
error, like an empty one. README and references/publish.md say so.
This goes beyond the literal PRD text ("literal strings, matched
case-insensitively") to close a leak of exactly what the profile is
meant to hide.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Overdeck-Agent: agent-okf-11
The diff is only the plan lifecycle fields (status, sequence, updated) that Overdeck wrote when the work session started. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Overdeck-Agent: agent-okf-11
Overdeck-Agent: agent-okf-11
Overdeck-Agent: agent-okf-11
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Overdeck-Agent: agent-okf-11
|
review verdict: blocked Private concept titles/descriptions leak onto public index pages: kept_index_lines misses reindex lines with ']' in titles, spaces in filenames, or multi-line descriptions (FR-3); --check passes |
Review CHANGES REQUESTED for OKF-11Review — OKF-11Verdict: CHANGES REQUESTED — private concept titles and descriptions leak onto public index pages (FR-3)Context
Blocking Findings[security/requirements] Index filtering misses listing lines that
|
| File | Status |
|---|---|
| .github/workflows/ci.yml | Reviewed: adds pytest install and a python -m pytest -q tests step after the selftest (matches WI-1). |
| scripts/publish.py | Reviewed: flow, finding ordering, --out safety, marker rebuild, redaction copies, check-mode line math. |
| scripts/publish_model.py | Reviewed: walk, visibility fail-closed, trust tier, classify_link rules 1-10, body_start_line, index frontmatter offsets. |
| scripts/publish_redact.py | Reviewed: profile validation, rule order, literal replacement, scan never returns matched text. |
| scripts/publish_markdown.py | Reviewed: escaping (all text runs and attributes escaped, \x00 stripped before placeholder use), safe_href, fences, lists, tables, footnotes, autolinks. No XSS path found. |
| scripts/publish_render.py | Reviewed: blocker in kept_index_lines; page shell, relative hrefs, generated listings, backlinks are otherwise correct. |
| scripts/publish_search.py | Reviewed: advisory on search_text. |
| scripts/publish_assets/search.js | Reviewed: uses only textContent/setAttribute/createElement; no innerHTML, eval or external URL; scoring matches §4.7. |
| scripts/publish_assets/style.css | Grep-checked only: no @import, url( or http. It has a system font stack, max-width: 48rem and a prefers-color-scheme: dark block. I did not read individual rules. |
| scripts/selftest.sh | Reviewed: only the command loop gains publish (NFR-3). |
| templates/okf-publish.yaml | Reviewed: id list matches DEFAULT_RULES; loads cleanly (covered by the test). |
| README.md, SKILL.md, docs/USAGE.md, references/publish.md | Reviewed: command rows identical in both tables; sections present; the "never published … titles in index listings" claim is currently false (blocker). |
| tests/conftest.py, tests/test_harness.py | Read in full. |
| tests/test_publish_*.py (6) | Partly read. I checked that every function name the PRD lists is present, plus extras (75 tests pass in CI). I read the bodies of test_no_unresolved_links, test_no_private_or_secret_bytes, test_out_safety and test_check_index_line_after_frontmatter_and_dropped_lines; they assert what the PRD requires. For the other tests I rely on the CI pass. No test covers bracketed or unbalanced titles, filenames with spaces, multi-line descriptions or nested-bracket links. |
| tests/fixtures/publish_bundle/** (11 files) | Read in full (except rules/index.md, read through the probe copy). They match the PRD fixture table. |
| .pan/drafts/OKF-11.md, .pan/specs/…xbrief.json, .pan/continues/OKF-11.xbrief.json | Not applicable for code review: planning artifacts. I read the PRD for requirements. |
NFR-3 check: git diff origin/main...HEAD --stat touches no existing script except scripts/selftest.sh; okf_common.py, validate.py, reindex.py and the template scripts are unchanged.
Dimensions
- Correctness: one blocker (index filtering), one advisory (search text). Visibility resolution, link classification, line numbers,
--outsafety and determinism are correct as traced. - Security: the renderer's HTML escaping and href scheme checks hold. The private-content leak is the blocker. The redaction pre-render gap is a hypothesis.
- Performance: quadratic backlinks (advisory, measured).
- Requirements/UX: see the matrix below.
Acceptance criteria
| AC | Status | Evidence |
|---|---|---|
| AC-1 pytest in CI | Met | ci.yml step; CI log 75 passed in 2.58s (run 43757998023). |
| AC-2 Markdown renderer | Met | test_publish_markdown passes in CI; escaping traced manually. |
| AC-3 redaction rules | Met | test_publish_redact passes; scan returns ids and lines only. |
| AC-4 publish model | Met | test_publish_model passes. |
| AC-5 site pages: "private listing lines are dropped" | Unmet for reindex-generated lines with bracketed titles or multi-line descriptions (blocker). Met for the fixture's simple lines. | |
| AC-6 search | Met for the unit tests (search.js has no innerHTML). Browser UAT is the test role's job, not verified here. Advisory on nested-bracket targets. |
|
AC-7 --out |
Met per the CI tests. test_no_private_or_secret_bytes passes only because the fixture has no bracketed titles. |
|
AC-8 --check gate |
Met (test passes in CI). | |
| AC-9 selftest | Met: CI log ok - SKILL.md documents /okf publish. |
|
| AC-10 docs | Met: ## Publishing a bundle at README:102. It contains x_visibility, okf-publish.yaml, cloudflare/wrangler-action@v3 and publish.py --bundle . --check. references/publish.md lists all seven P_* codes. |
Verification
gh pr checks 12: bothselftestjobs pass on HEAD 2aa7417. The CI job runsbash scripts/selftest.shandpython -m pytest -q tests(75 passed). I reused this run and did not re-run the full suite.- Probe 1 (scratchpad probe1): hand-added bracketed private listing line plus nested-bracket body link. Private title and description appear in
out/rules/index.html, and the private target appears insearch-index.json. - Probe 4 (scratchpad probe4): the same leak using the real
reindex.pyoutput for a bracketed title and a multi-line description.--checkexits 0 and--outpublishes the private text. - Probe 5 (scratchpad probe5): a filename with a space and an unbalanced
]title, both private, leak through reindex → publish. The escape and emphasis split defeats redaction and--check. - Probe 2: the
templates/repobundle passes--check(0 public concepts), so its README.md/CONTRIBUTING.md frontmatter causes no parse errors. - Probe 3: synthetic 1,501-concept bundle, publish took 29.9 s.
npm run lint:effect-diagnostics: not applicable (Python/stdlib repo with no TypeScript or Effect).- All probes ran in the session scratchpad. No tracked files were edited.
Scope Note
- The manifest's
acceptanceCriterialist was empty. I used PRD §3 (FR/NFR) and §7 (AC-1 to AC-10) from.pan/drafts/OKF-11.mdas the acceptance criteria. - The local
mainref in this worktree does not match the PR base (origin/main92a21fe). The PR diff itself is correct.
Source: /home/eltmon/Projects/okf/workspaces/feature-okf-11/.pan/review/agent-okf-11-review-2aa74173/review.md
Required action
Fix every blocking review finding, commit the fixes, then re-request review with:
pan review request OKF-11 -m "Fixed review issues"
Blocking review finding: kept_index_lines classified listing lines with okf_common.LINK_PATTERN, which cannot parse reindex.py output for a title containing "]", a file name with a space, or a multi-line description's continuation line. Those lines were kept, so private titles and descriptions reached public index pages while --check passed. - Inside the OKF:INDEX marker block, a line now survives only when it is a listing line whose first link positively resolves to a public concept or a published directory (review option a). Private entries, continuation lines and unparseable lines are dropped. Outside the block, hand-written listing lines to unpublished targets are dropped as before, and other prose is kept. - Link detection uses new publish_markdown.find_links, built on the renderer's own bracket and destination parsers, so the filter and the renderer agree on what is a link. Advisory findings: - search_text strips links with the same parser (strip_links), so a nested-bracket link no longer leaves a private target in search-index.json. - --check also scans each body and index line as the reader sees it (visible_text: links as text, backslash escapes and emphasis markers removed), so "**Alice** Example" or "/home\/alice" fail the gate. - PublishModel caches public_ids, public_dirs and a reverse-link map, so publishing is linear: a 1,501-concept bundle with 10 links each now publishes in 0.82 s (reviewer measured 29.9 s). - The template's private-strings comment mentions line breaks. Regression tests run real reindex.py output with a bracketed title, an unbalanced "]" title, a file name with a space and a multi-line description on private concepts, and assert none of their text reaches any output file; a public bracketed title stays listed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Overdeck-Agent: agent-okf-11
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Overdeck-Agent: agent-okf-11
|
review verdict: passed Prior leak blocker fixed: index block fails closed, search strips nested links, --check scans visible text, backlinks linear; probes clean, CI 82 passed |
Issue: #11
Acceptance Criteria