Skip to content

Docs Hub sprint-3 closure + dashboard sticky TOC#58

Merged
cdarnell merged 9 commits into
mainfrom
qukaizen/arail-dashboard-toc
May 17, 2026
Merged

Docs Hub sprint-3 closure + dashboard sticky TOC#58
cdarnell merged 9 commits into
mainfrom
qukaizen/arail-dashboard-toc

Conversation

@cdarnell
Copy link
Copy Markdown
Owner

@cdarnell cdarnell commented May 17, 2026

Summary

Bundles two pieces of work on the same branch:

docs-hub-sprint-3 — closure of the Docs Hub effort

Master plan Phase D + E + cleanup, all four planned steps shipped:

  1. Test-infra fixtests/test_docs_registry_qa.py _fresh_registry helper now rebinds arail.portal.app._docs_registry via monkeypatch.setattr instead of del sys.modules[...]. Sister test_live_repo_* helpers fixed in the same commit (F5).
  2. Cross-link audit — new tests/test_docs_links.py walks every [label](path.md) in the docs corpus and asserts it resolves. 3 broken links repaired:
    • docs/build-and-finetune-plan.mdportal-design.md
    • ROADMAP.mdportal-design.md
    • CONTRIBUTING.md — dead docs/wiki.md link removed
  3. Delete docs/INDEX.md + permanent 301 redirect to /docs Hub (preserves old bookmarks).
  4. LanceDB ingestpkb.index_all now includes registered docs alongside user notes. 4 KB embedding cap respected; perf test 0.70s (budget 2.0s).

Verdicts: REVIEW = PASS · QA = PASS (18 new tests, 158/158 docs-domain green, 0 FAIL).

Ride-along: dashboard sticky TOC

Charles's 5df5725 adds a slim sticky strip below the meter bar with six anchor chips (Mission · Status · Activity · Report · Knowledge · Network) that smooth-scroll to each card. Self-contained, harmless, predates the sprint-3 branching.

Carry-overs to next sprint

  • LOW — _MD_LINK_RE only matches lowercase .md (re.IGNORECASE follow-up; pin test landed)
  • LOW — F5 cross-domain test contamination remains: full-suite ordering surfaces docs_routes_qa.py flakes. Pre-existing (git stash of sprint-3 leaves failures identical). Recommended: session-scoped autouse fixture restoring app._docs_registry to import-time value after every test.
  • 6 docs_routes_qa isolation flakes + 7 unrelated pre-existing failures (swarm_goal_surfaces, system_metrics, opencode lifecycle, airgap_happy) — all reproducible on parent state.

Test plan

  • pytest tests/test_docs*.py tests/test_docs_links.py tests/test_docs_ingest.py tests/test_docs_sprint3_qa.py → 158/158 in isolation
  • Manual: visit /docs/INDEX.md → 301 to /docs
  • Manual: open Dashboard, confirm sticky TOC strip works
  • Manual: search the KB after pkb_index_all — docs are findable

🤖 Generated with Claude Code

cdarnell and others added 9 commits May 16, 2026 21:57
…+ E + cleanup)

Closure sprint of the Docs Hub effort. Scope: LanceDB ingest of docs/,
cross-link audit, delete docs/INDEX.md, fix sys.modules test hazard.
All four are Sprint 2 carry-overs. Scope ceiling: 8 files, 120 LOC
production, 300 LOC tests, 0 new deps. Implementation order is
revert-able step-by-step.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ys.modules with reload + setattr

The old helper used `del sys.modules[mod_name]` + re-import, creating a
new module object.  arail.portal.app._docs_registry kept the old object,
so patches applied via the helper were invisible to app routes — the F5
carry-over flake from TEST_REPORT.md.

Fix:
- _fresh_registry now calls importlib.reload() on the existing module
  object (preserving identity) then patches _repo_root and _docs_registry
  on app.py via monkeypatch.setattr for proper teardown.
- test_live_repo_* tests switch from del sys.modules to importlib.reload
  for the same reason — they were the contamination source that caused
  the ordering-dependent failures.
- New test: test_fresh_registry_rebinds_app_module_reference pins the fix.

All 126 docs test pass together (125 pre-existing + 1 new).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds a slim sticky strip below the meter bar with six anchor chips —
Mission · Status · Activity · Report · Knowledge · Network — that
smooth-scroll to each card. Quick Actions stays where it is (those are
real verbs, not nav).

- Invisible .dash-anchor spans placed just above each card carry the
  #dash-* targets so we don't have to repurpose existing card ids.
- scroll-margin-top: 56px keeps the heading clear of the sticky TOC.
- Translucent dark background + backdrop blur so the strip reads as
  chrome, not a section.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…n.md/wiki.md links

New test file tests/test_docs_cross_links.py:
- test_cross_link_audit_all_internal_links_resolve: walks the registered
  docs corpus, strips fenced code blocks, asserts every [label](*.md) link
  resolves to an existing file (F3, F4).
- test_cross_link_audit_allowlist_is_minimal: pins allowlist size ≤10 so
  unexpected growth surfaces in CI.
- test_cross_link_audit_code_fence_false_negative_is_blocked: confirms
  links inside ``` fences are stripped before the regex sweep (F4).
- test_cross_link_audit_real_link_outside_fence_is_caught: positive case.
- test_cross_link_audit_perf_under_one_second: full audit < 1s (F10).

Broken links fixed (edit the doc, not the allowlist — per architect spec):
- docs/build-and-finetune-plan.md: ./design.md → ./portal-design.md
- ROADMAP.md: docs/design.md → docs/portal-design.md
- CONTRIBUTING.md: docs/wiki.md removed (no wiki.md exists; pointed at /wiki tab)

Broken-link count in registered docs: 3 → 0.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…rect + regression tests

- docs/INDEX.md deleted: the legacy Hub placeholder that the denylist
  has blocked since Sprint 1. /docs now renders the registry-driven Hub
  directly; the file served no purpose on disk.

- app.py: add GET /docs/INDEX.md → 301 /docs permanent redirect handler.
  The handler intentionally does NOT read the file — it fires regardless
  of whether INDEX.md is on disk, preserving any external bookmarks (F6).

- tests/test_docs_routes.py:
  - test_viewer_renders_doc_without_registry_entry: updated from 200
    assertion (Sprint 2, file existed) to 301 assertion (Sprint 3, file
    deleted). Documents the intent change inline.
  - test_docs_index_md_redirect_still_works: primary F6 sentinel — asserts
    301 to /docs after file deletion.
  - test_index_md_file_does_not_exist: belt-and-suspenders file-gone check
    so a future restore is caught immediately.

All 133 docs tests pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…des registered docs

src/arail/pkb.py:
- New helper _build_docs_rows(): iterates docs_registry.all_docs(), builds
  one LanceDB row per doc with source_kind='docs'.  Row schema matches PKB
  (path/name/vector/mtime/source_kind) so search callers need no changes.
  Namespaces paths as "docs/<slug>.md" or "root/<slug>.md" to prevent future
  PKB/docs collisions.  Body capped at 4 KB (same as PKB, per F1 perf guard).
  Registry failures log a warning and return [] — docs ingest never blocks
  PKB ingest (F8 isolation contract).
- index_all() gains include_docs=True kwarg (default preserves prior behaviour).
  Return dict gains indexed_docs key (0 when include_docs=False or registry empty).

tests/test_docs_ingest.py (new, 7 tests):
- test_index_all_includes_docs_rows: indexed_docs ≥ 1, source_kind='docs' (contract)
- test_index_all_include_docs_false_skips_docs: opt-out works, no docs rows in DB
- test_index_all_handles_registry_failure_gracefully: PKB still indexes on failure (F8)
- test_index_all_empty_body_doc_does_not_crash: empty body slice '' is safe (F7)
- test_index_all_stale_doc_removed_on_reingest: replace() semantics removes stale (F2)
- test_index_all_source_kind_docs_does_not_pollute_pkb_source_kind: isolation (F8)
- test_index_all_perf_under_2s: synthetic-50 PKB + real-24 docs < 2.0s (F1)

Full 140-test docs suite passes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…plete

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…tests

QA findings: 0 FAIL, 2 LOW (mixed-case .MD audit gap pinned; F5
cross-domain test contamination is pre-existing, not introduced by
this sprint — recommended session-scoped autouse fixture follow-up).

Coverage: LanceDB re-ingest idempotency, 4 KB embedding cap, empty
docs/ dir, missing frontmatter, INDEX.md redirect (301 + query string
+ case variants), 3-way concurrent index_all (no deadlock), cross-link
edge cases (anchors, query strings, backticks, mixed-case .MD),
sys.modules rebind hermeticity over repeated calls.

Closes docs-hub-sprint-3. Ready to ship.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@cdarnell cdarnell changed the title feat(dashboard): sticky TOC strip for quick section jumps Docs Hub sprint-3 closure + dashboard sticky TOC May 17, 2026
@cdarnell cdarnell merged commit daec65a into main May 17, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant