Skip to content

Commit 5a0ce50

Browse files
AronAron
authored andcommitted
v4.5.3: gap closure, agent navigability, ACS actionable, selective work
First-run/steady-state agent contract, pure-Py workflow routes, ghost deletion hygiene, ACS actionable_low_conf, G12 harness extract + AGENT MAP docs, daemon maps throttle. README + protocol for agent-first wiki.
1 parent 72e8637 commit 5a0ce50

29 files changed

Lines changed: 1787 additions & 1163 deletions

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,31 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
---
99

10+
## [4.5.3] - 2026-07-09
11+
12+
### Added
13+
14+
- **Agent first-run / steady-state contract** in README + protocol: map first, wiki
15+
prose agent-filled; selective 🔴/🟡 work only.
16+
- **ACS v1.1** fields: `actionable_low_conf_edges`, `external_noise_edges` (stdlib /
17+
bare demoted for agent next-steps; full telemetry retained).
18+
- **Ghost detection**: missing disk paths → Red DELETED on check-changes;
19+
`find_ghost_entries` / validate ghosts; `record-deletion` CLI + BRC prune.
20+
- **CLI pure-Python routes**: `suggest-next`, `record-deletion`, `validate`.
21+
- **AGENT MAP** docstrings on core modules; self-tests moved to `tests/selftest/`.
22+
- **MCP Core 6** documented (status, check_changes, needing_attention, wiki, suggest, record/mark).
23+
- Daemon: `WIKIFIER_DAEMON_MAPS_INTERVAL` (default 600s) and `WIKIFIER_DAEMON_MAPS=0`.
24+
25+
### Fixed
26+
27+
- Agent navigability (G12): no inlined parser harnesses at bottom of production modules;
28+
protocol architecture table for agents.
29+
30+
### Changed
31+
32+
- `suggest_next_actions` prioritizes health red/yellow and actionable ACS only.
33+
- `init` prints agent first-run next steps (not only human serve).
34+
1035
## [4.5.2] - 2026-07-09
1136

1237
### Fixed

Findings/gap-closure-report.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Gap Closure Report — Agent-Focused Project Wiki
2+
3+
**Program:** Gap Closure Swarms
4+
**Baseline:** v4.5.2 → worktree post-gap-closure
5+
**Completed:** 2026-07-09
6+
**subid:** gap-swarm-coord
7+
8+
## North star
9+
10+
Wikifier = any project's **agent-focused wiki**: first setup builds a **map**; later agents only touch files that need update/remove/change; MCP for anytime lookup; humans observe via thin HTML. Map is automated; wiki **prose** is agent-filled.
11+
12+
## Gap matrix
13+
14+
| ID | Gap | Severity | Status | Evidence |
15+
|----|-----|----------|--------|----------|
16+
| G1 | Product loop under-documented | S1 | **Closed** | README first-run + steady-state; protocol session block; init stdout |
17+
| G2 | First setup map vs semantic investigate | S1 | **Closed** | Honest “map first, wiki later” in README/protocol/init |
18+
| G3 | Agents re-touch green / full-tree | S1 | **Closed** | `suggest_next_actions` selective; protocol SELECTIVE WORK |
19+
| G4 | ACS noise (external/bare as oracle) | S1 | **Closed** | `actionable_low_conf_edges` + demote external; suggest uses it; tests |
20+
| G5 | `health` name shadow | S1 | **Closed** | `health_module` export; MCP importlib; tests; docs |
21+
| G6 | Dual shell/Python residue | S2 | **Closed** (partial) | Pure-Py: check/record/mark/deletion/suggest/validate; launchers synced; shell init improved |
22+
| G7 | Deletion / ghost health entries | S1 | **Closed** | `find_ghost_entries`; check_changes marks ghosts; record_deletion + BRC prune; tests |
23+
| G8 | Issue tracker overclaim | S2 | **Closed** | Docs: journal/pending = audit queue not Jira |
24+
| G9 | Language coverage honesty | S1 | **Closed** | Deep maps = py/js/ts only (README/protocol/init) |
25+
| G10 | Sample dogfood cache vs health | S2 | **Closed** (smoke) | llama_index + redox check/suggest; contract: monitored ≠ map scope documented |
26+
| G11 | Monitor/daemon ops | S2 | **Closed** | Daemon maps interval default 600s; `WIKIFIER_DAEMON_MAPS=0`; start/stop smoke |
27+
| G12 | Complexity / agent-hostile surface | S2→**Closed** | **Closed** | Harnesses → tests/selftest/; AGENT MAP docs; MCP Core 6; dual-path legend; bree/health headers thinned |
28+
29+
## Fix backlog (executed)
30+
31+
1. W1-A G5 health_module + tests
32+
2. W1-B G4 ACS actionable fields + filter
33+
3. W1-C/G3 suggest selective + MCP delegates to lib
34+
4. W1-E G7 ghosts + record_deletion prune + CLI routes
35+
5. W1-D docs/protocol/README
36+
6. W2 init agent first-run lines; daemon maps throttle; dogfood smoke
37+
38+
## Wave notes
39+
40+
### Wave 0 — Investigation
41+
Three explore agents (INV-CONTRACT, INV-TRUST, INV-OPS) produced severity-ranked proposals. Coordinator implemented high-leverage fixes without language expansion or dashboard growth.
42+
43+
### Wave 1–2 — Implementation
44+
- `wikifier/import_cache.py``_edge_is_external_noise`, ACS v1.1 actionable fields
45+
- `wikifier/cli.py` — selective suggest, record_deletion prune, check ghosts, CLI routes
46+
- `wikifier/health.py``find_ghost_entries`, validate ghosts
47+
- `wikifier/mcp/server.py` — suggest → library
48+
- `wikifier/__init__.py``health_module`
49+
- `wikifier/daemon.py` — maps interval
50+
- `wikifier/scripts/wikifier.sh` + root — init messaging
51+
- `tests/test_gap_closure.py` — 4 new tests
52+
- README + skills/run.md — contracts
53+
54+
### Wave 3 — Verification
55+
- **34/34** unittest OK
56+
- Dogfood: llama_index / redox check-changes + suggest (selective copy)
57+
- Daemon start/status/stop on temp fixture with `WIKIFIER_DAEMON_MAPS=0`
58+
59+
## Residual / deferred
60+
61+
| Item | Reason |
62+
|------|--------|
63+
| G12 full megamodule split (js/bree) | Not required for navigability after AGENT MAP + harness extract |
64+
| update-maps honor monitored_paths | Compat risk; document scope instead |
65+
| Unshadow package attr `health` to module only | Breaking for `from wikifier import health` function API |
66+
| Multi-month daemon proof | Out of scope; smoke + runbook only |
67+
| New language parsers | Explicit non-goal |
68+
69+
## Agent contract (canonical)
70+
71+
**First-run:** `init``update-maps``health --summary``suggest-next`
72+
**Steady-state:** `check-changes` → edit 🔴/🟡 only → `record-change` → wiki → `mark-green``update-maps` if structure changed; `record-deletion` on remove
73+
**Lookup anytime:** MCP status / wiki / deps
74+
**Limits:** deep maps py/js/ts; journal≠Jira; not fully autonomous without agent judgment
75+
76+
## Tests
77+
78+
```bash
79+
python3 -m unittest discover tests # 34 tests
80+
```

README.md

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,65 +8,63 @@
88

99
Wikifier is an **agent-to-agent** tool: it builds a living map of a project (health matrix, dependency graph, short file summaries) and agents keep that map current as they work. Humans can peek via a small dashboard; the product is the agent loop, not a general docs site or IDE.
1010

11-
Works from small scripts to large monorepos (Python + JavaScript/TypeScript imports, barrels, cycles, incremental updates).
11+
Works from small scripts to large monorepos. **Deep import maps** cover **Python + JavaScript/TypeScript** (barrels, cycles, incremental updates). Other languages can still use health/journal/watch; they won’t get full import graphs until a parser exists.
1212

1313
## Why
1414

1515
Context windows are finite. Re-reading a large file to answer “what is this and who depends on it?” wastes tokens.
1616

17-
Wikifier keeps a small set of artifacts agents can query:
18-
1917
| Artifact | Role |
2018
|----------|------|
2119
| `file_health.md` | 🟢 / 🟡 / 🔴 matrix — what to trust, what to fix first |
2220
| `library.md` | File tree, Mermaid dependency map, import tables, cycles + confidence |
23-
| `*.wiki.md` | Short per-file “what this is for” notes (agent-maintained) |
24-
| `journal/` | Semantic *why* trail from `record-change` |
21+
| `*.wiki.md` | Short per-file “what this is for” notes (**agent-maintained** prose) |
22+
| `journal/` + `pending_updates.md` | Semantic *why* trail + work queue (audit, **not** a full issue tracker) |
2523

26-
Lookup beats re-ingest. That’s the whole idea.
24+
**Map first, wiki depth second:** `update-maps` builds the structural map automatically. Rich per-file wiki text is filled by agents as they work — not a free full-repo “understand everything” pass on init.
2725

28-
## Quick start
26+
## First run (bootstrap the map)
2927

3028
```bash
3129
pip install wikifier # pure Python stdlib core — no runtime deps
3230
pip install wikifier[mcp] # optional Model Context Protocol (MCP) server
3331

3432
cd /path/to/your/project
35-
wikifier init
36-
wikifier update-maps # dependency graph + library.md
37-
wikifier check-changes
38-
wikifier health --summary
33+
wikifier init # seeds + human index.html
34+
wikifier update-maps # full structural map → library.md + import cache
35+
wikifier health --summary # matrix counts
36+
wikifier suggest-next # or MCP suggest_next_actions — 🔴/🟡 only
3937
```
4038

41-
Always set an explicit root for external trees:
39+
Always set an explicit root for external trees: `WIKIFIER_PROJECT_ROOT=/abs/path wikifier …`
4240

43-
```bash
44-
WIKIFIER_PROJECT_ROOT=/abs/path/to/project wikifier check-changes
45-
```
46-
47-
## Agent loop
41+
## Steady state (only touch what needs it)
4842

4943
Full protocol: [`skills/run.md`](skills/run.md).
5044

5145
```bash
52-
wikifier check-changes
53-
# prioritize 🔴 then 🟡 in file_health.md / pending_updates.md
54-
# ... edit source ...
46+
wikifier check-changes # yellow dirty files; red ghosts (missing paths)
47+
# prioritize 🔴 then 🟡 — do NOT re-wiki 🟢 Green files
48+
# ... edit only those sources ...
5549
wikifier record-change "path/file.py" "why this changed" # required
56-
# ... refresh that file’s wiki summary ...
50+
# ... refresh that file’s wiki summary only ...
5751
wikifier mark-green "path/file.py"
58-
wikifier update-maps # if imports/structure changed
52+
wikifier update-maps # only if imports/structure changed
53+
# removals:
54+
wikifier record-deletion "path/gone.py" "why removed"
5955
```
6056

61-
`record-change` logs intent a git diff can’t reconstruct for the next agent (or human).
57+
MCP **Core 6** (start every session): `get_project_status`, `check_changes`, `get_files_needing_attention`, `get_file_wiki`, `suggest_next_actions`, `record_change` / `mark_green`. Intel as needed: `get_dependencies`, `get_dependents`, `get_cycles`. Always pass `project_root=` for external trees.
6258

6359
## What you get
6460

6561
- **Import analysis** — Python + JS/TS (ESM, CommonJS, dynamic imports, path aliases, package exports); per-edge confidence; name-routed barrel expansion (precise leaves, not edge explosion)
6662
- **Incremental pipeline** — pure-Python `update-maps`: dirty parse → import cache → reverse deps → cycles → `library.md`
63+
- **Selective agent work** — health + suggest bias to 🔴/🟡 only; ACS *actionable* low-conf excludes stdlib/external noise
6764
- **Scale** — reverse index + barrel invalidation so one edit doesn’t re-scan the monorepo
68-
- **MCP tools** — optional server for Claude, Cursor, Cline, and other MCP clients (`get_project_status`, `get_dependencies`, `get_file_wiki`, `record_change`, …)
65+
- **MCP tools** — optional server for Claude, Cursor, Cline, and other MCP clients
6966
- **Zero core dependencies** — stdlib only; forks can add their own stack on top
67+
- **Agent navigability** — short **AGENT MAP** docstrings on core modules; self-tests under `tests/` (not buried in parsers)
7068

7169
## Performance (measured)
7270

@@ -86,13 +84,16 @@ Tests: `python -m unittest discover tests` (stdlib only).
8684
| `wikifier check-changes` | Incremental scan → health / pending |
8785
| `wikifier record-change <file> "reason"` | Log *why* (required after edits) |
8886
| `wikifier mark-green <file>` | Mark wiki current |
87+
| `wikifier record-deletion <file> "reason"` | Mark removed paths 🔴 + prune barrel refs |
88+
| `wikifier suggest-next` | Next actions (🔴/🟡 only) |
8989
| `wikifier update-maps [--directory=src/] [--max-files=N]` | Rebuild graph + `library.md` |
9090
| `wikifier health [--summary\|--json]` | Health matrix (machine-friendly flags) |
91+
| `wikifier validate` | Missing wiki rows + ghost paths |
9192
| `wikifier cycles` | Circular deps + break hints |
92-
| `wikifier monitor` / `daemon` | Background maintenance |
93+
| `wikifier monitor` / `daemon` | Background maintenance (`WIKIFIER_DAEMON_MAPS=0` for check-only) |
9394
| `wikifier serve` | Localhost dashboard with Run/Stop |
9495

95-
Library: `from wikifier import check_changes, record_change, mark_green, health, update_maps`.
96+
Library: `from wikifier import check_changes, record_change, mark_green, suggest_next_actions, update_maps, health`.
9697

9798
## MCP
9899

@@ -114,6 +115,8 @@ Setup and tool list: [`wikifier/mcp/README.md`](wikifier/mcp/README.md).
114115
**In:** agent-maintained codebase wiki, dependency intelligence, token-saving lookup for LLMs and coding agents.
115116
**Out:** general human documentation systems, IDE plugins, “docs for everyone” product growth.
116117

118+
**Agent navigability:** Prefer protocol ([`skills/run.md`](skills/run.md)) + MCP Core 6 over reading 20k LOC of parsers/cache. Production modules carry a short **AGENT MAP** docstring; self-tests live under `tests/` and `tests/selftest/`, not inline at the bottom of parsers.
119+
117120
## Links
118121

119122
- [PyPI](https://pypi.org/project/wikifier/) · [GitHub](https://github.com/IronAdamant/wikifier)

0 commit comments

Comments
 (0)