ifURI docs

Quality and docs audit - 2026-06-29

This audit answers two questions:

Inputs

Commands run from /home/tom/github/if-uri:

PYTHONPATH=/home/tom/github/semcod/env2llm/src \
  python3 -m env2llm.cli . --project-id if-uri --format yaml --no-merge

PYTHONPATH=/home/tom/github/semcod/docval/src \
  python3 -m docval.cli scan docs --project .

PYTHONPATH=/home/tom/github/semcod/docval/src \
  python3 -m docval.cli scan urirun/docs --project .

PYTHONPATH=/home/tom/github/semcod/redup/src \
  python3 -m redup.cli_app.main compare \
    urirun/adapters/python/urirun_scanner urirun-connector-scanner \
    --no-community --min-lines 8

python3 codebase_audit.py --root . --list --json
python3 codebase_audit.py --root . --list --dimension all --fail-at 7

Current state

The core architecture is mostly aligned with the current refactor direction:

Measured health:

Docs that need correction or reclassification

File or areaProblemAction
docs/index.md, docs/README.mdstill call 2026-06-20 work summary and structure audit "current"point readers to this audit and call old summaries historical
URI_ECOSYSTEM_ATOMIZATION_AUDIT.mdgood 2026-06-28 snapshot, but several numbers are now older than the current splitkeep as historical predecessor; this file supersedes it for quality/doc status
URIRUN_CONTRACT_REFACTORING_REPORT.mddated report with live-run assertions and old coverage numberskeep as historical evidence; current AS-IS lives in the newer architecture and refactor-plan docs
human-connector/memory/ifuri-contract-layer-state.mdsays production twin still uses a hard-coded reversibility table and fleet coverage is only about 3/40; current docs and tests show later statemark as historical memory or refresh from ACTIVE_REFACTOR_PLAN.md
urirun/docs/URIRUN_PACKAGE_SPLIT_PLAN.mdtop status block still contains historical details such as runtime/v2.py 2593 -> ~1970 and handlers staying in v2, while current code uses v2_cmds and v2.py is about 1658 linesrewrite the dated decomposition block or move it under an explicit "historical 2026-06-23" section
project/*, urirun/project/*, */project/*, code2llm_output/*generated maps are useful evidence but contain stale symbol references after refactorsnever cite them without rerunning code2llm; exclude from doc source-of-truth
docs/examples with 192.168.188.*, lenovo, fixed portsmany are lab fixtures, but they read like operational defaultsconvert production docs to placeholders/env vars; keep concrete LAN values only in clearly named fixture examples
connector/service READMEs generated from templatesseveral still describe package shape rather than current ownership, contracts and service manifestsregenerate or patch per package after ownership changes

Code quality front

The next refactors should not target line count alone. The active risks are:

1. Hardcoded environment facts. The remaining production-code findings are model literals, service ports and localhost URLs. Node aliases, monitor connectors, absolute home paths and private LAN IPs are now fixture-only findings after removing the lenovo execution default from the app runtime path. 2. Large orchestration modules. The current audit has no large module above threshold; _opencv_document_crop in urirun-connector-smart-crop/core.py remains as the only orchestration finding. The right extraction unit is a typed URI capability, contract, service or twin query, not a prettier helper split. 3. Documentation freshness. docval is green enough for a gate, but only if generated snapshots are excluded and historical docs are labeled.

Semcod tools to adopt

ToolUse in if-uriGate shape
env2llmgenerate live environment facts before autonomy tests and route/twin diagnosiswrite .nlp2dsl/registry/environment.yaml; compare key facts with Twin inventory
docvalscan Markdown source docs for empty/orphan/task-marker sectionsrun on docs and urirun/docs; exclude generated folders
redupdetect cross-package real-source driftcompare known risky pairs: scanner fallback vs connector, widget renderers, router shims, flow shims
code2llmregenerate code maps before using hotspot claimsupdate generated project/map.toon.yaml only as evidence, never hand-edit
pyqualorchestrate repeated audit/test/report loopsadd pyqual.yaml later, after docval/redup/env2llm commands are stable
nlp2uriconvert NL examples into URI-plan golden corporafeed testing/ and examples/44-chat-prompt-sweep
prefactcatch import and refactor hazards before/after large code movesrun on touched Python packages in extraction PRs
planfileturn audit output into tracked taskssync this audit into refactor tickets once priorities are accepted

Proposed next refactor order

1. Docs source-of-truth patch. Update docs/index.md, docs/README.md and docs/source-of-truth.md so 2026-06-20/28 reports are no longer labeled "current" when this audit supersedes them. 2. Scanner single-source decision. Make urirun-connector-scanner the source of truth or explicitly document why the adapter fallback remains a second implementation. If it remains, add a redup ratchet. 3. Hardcoded environment burn-down. Split audit findings into fixtures vs production. Production occurrences move to config/inventory/env-domain resolution; fixture occurrences get comments or example-local env defaults. 4. Package docs refresh. For packages already extracted (urirun-flow, urirun-connector-router, urirun-connector-twin, services, widgets, artifacts), update README/architecture docs after each ownership change. 5. CI quality target. Add a lightweight make docs-quality or scripts/docs_quality_audit.sh that runs docval, env2llm, selected redup comparisons and codebase_audit --list --json.

Acceptance criteria