> ## Documentation Index
> Fetch the complete documentation index at: https://docs.monolex.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Work Wiki

> Work Wiki 0.3.0 — cross-layer work history, intent, sessions, project knowledge, file biography, and code-to-document convergence.

Work Wiki turns work artifacts into queryable knowledge. It joins conversation, file activity, git history, saved diffs, research, plans, proofs, and published documents by time and file path, then adds project context and code-topic coverage from [Monoflow](/ai-clis/monoflow).

*Documents Work Wiki 0.3.0, OpenCLIs build `2026-07-12-192629`.*

*Registry ownership: the canonical `docs_url` is this page, the public product
homepage is `https://monolex.ai`, and Work Wiki pairs with Monoflow, Monogram,
Monogit, Monomento, NIIA, and MonoLog. Repository ownership remains
`monolex/monolex`; no public source URL is advertised while that repository is
private.*

## Install and identify the contract

```bash theme={null}
openclis install work-wiki
work-wiki --version
work-wiki --help
work-wiki verify
```

The installed short guide lists 16 primary commands. The 0.3.0 dispatcher also implements six advanced or compatibility commands—`timeline`, `sessions`, `knowledge`, `reindex`, `all-projects`, and `convergence`—for a total of 22 canonical feature commands. This page documents both surfaces.

## Three work layers, nine source families

| Layer  | Source families                                    | What they answer                                                                    |
| ------ | -------------------------------------------------- | ----------------------------------------------------------------------------------- |
| Action | saved diffs, watcher events, Monogit commits       | What changed, where, when, and whether a save was later linked to a commit          |
| Talk   | PTY activity, NIIA memory, local transcripts       | Which AI or human session was active and what operation pattern surrounded the work |
| Know   | Work Wiki markdown, Monomento index, summary store | Which research, plan, proof, final doc, or durable summary explains the work        |

Time and file path are the practical join keys. The databases remain independently owned; Work Wiki opens them as evidence sources rather than pretending they form one foreign-key schema.

## The Monoflow loop

Work Wiki and Monoflow are not a simple one-way stack:

```text theme={null}
file save ──► work-wiki-diff.db ──► Monoflow temporal analysis
                                           │
                                           ▼
              Work Wiki ◄── search · insights · code topics
                   │
                   ▼
       project context · knowledge · convergence
```

* Work Wiki is upstream when it records saved-diff evidence that Monoflow reads.
* Work Wiki is downstream when its search and status call Monoflow's code/git/document composition.
* Work Wiki owns `convergence`, because code topics need to be compared with the per-project knowledge database.
* [NIIA](/ai-clis/niia) consumes Work Wiki status, convergence, and knowledge signals through its integrated commands.

## Normal workflow

```bash theme={null}
# Index Work Wiki artifact folders.
work-wiki index

# Confirm that the independent evidence stores are reachable.
work-wiki verify
work-wiki status

# Search and trace without rebuilding.
work-wiki search "SessionActor"
work-wiki recent --hours 24
work-wiki file src/lib.rs
```

For per-project Monomento-backed knowledge and code-topic coverage:

```bash theme={null}
work-wiki knowledge index <project-slug>
work-wiki knowledge status <project-slug>
work-wiki convergence
```

## Complete 22-command CLI inventory

The inventory counts canonical feature commands. `help` and `version` are metadata; `ap` and `conv` are aliases, not additional commands.

### Primary 16-command guide surface

| Command                          | Storage | Purpose and important options                                                                                                                           |
| -------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `work-wiki index [project]`      | Write   | Index all Work Wiki projects or one named project through the artifact indexer                                                                          |
| `work-wiki search <query>`       | Read    | Search saved diffs, wiki/knowledge, summaries, Monoflow code/git, and optionally conversation; `--diff`, `--docs`, `--summary`, `--all`, `-n`, `--json` |
| `work-wiki diff <file>`          | Read    | Show saved line-diff history; `--limit <N>`, `--raw`, `--json`                                                                                          |
| `work-wiki status`               | Read    | Report layer counts, freshness, funnel, writer health, and Monoflow signals; `--json`                                                                   |
| `work-wiki projects`             | Read    | List project directories discovered under the Work Wiki artifact root; `--json`                                                                         |
| `work-wiki artifacts <project>`  | Read    | Count project documents by category; `--category`, `--wip`, `--wiki`, `--json`                                                                          |
| `work-wiki docs [topic]`         | Read    | List or read the agent reference embedded in the installed binary                                                                                       |
| `work-wiki recent`               | Read    | Merge recent diff, watcher, git, and wiki events; `--hours <N>`, `-n`, `--json`                                                                         |
| `work-wiki intent [name]`        | Read    | List human-named terminal topics or inspect one topic's lifetime, providers, diffs, and related docs; `--json`                                          |
| `work-wiki session [id] [limit]` | Read    | List real PTY sessions or inspect one session's operations, files, diffs, docs, and transcript; `--json`                                                |
| `work-wiki context <project>`    | Read    | Join OnIt folders, recent saves/commits, active intent, and funnel state; `--since <hours>h`, `--json`                                                  |
| `work-wiki impact <query>`       | Read    | Correlate a topic with wiki documents, recent commits, changed files, and PTY operations; `--json`                                                      |
| `work-wiki patterns`             | Read    | Analyze local-time save patterns, independent git activity, languages, hot files, PTY operations, and edit bursts; `--days`, `--json`                   |
| `work-wiki file <path>`          | Read    | Build one file biography from PTY, watcher, diff, git-touch, and wiki-reference evidence; `--json`                                                      |
| `work-wiki verify`               | Read    | Probe database presence, Monogit access, diff-to-commit coverage, watcher/diff correlation, and PTY coverage                                            |
| `work-wiki backfill`             | Write   | Retroactively fill nullable `committed_hash` values in saved diffs from Monogit commits                                                                 |

### Six advanced and compatibility commands

| Command                            | Alias  | Storage           | Purpose and important options                                                                            |
| ---------------------------------- | ------ | ----------------- | -------------------------------------------------------------------------------------------------------- |
| `work-wiki timeline [query]`       | —      | Read              | Cross-layer event timeline; `--since <hours>h`, `-n`, `--all`, `--layer <tag>`, `--json`                 |
| `work-wiki sessions`               | —      | Read              | Reconstruct work sessions by clustering diff saves; `--since <hours>h`, `--gap <minutes>`, `--json`      |
| `work-wiki knowledge <subcommand>` | —      | Mixed             | Manage the per-project knowledge database; the complete six-subcommand surface is below                  |
| `work-wiki reindex`                | —      | Write/orchestrate | Run `monoflow analyze --full`, then `work-wiki knowledge index`                                          |
| `work-wiki all-projects`           | `ap`   | Read              | List active OnIt projects, folders, last activity, and per-project knowledge DB presence                 |
| `work-wiki convergence`            | `conv` | Read              | Compare Monoflow code topics with research/prepare/prove/docs coverage in the resolved knowledge project |

The dispatcher also accepts `--help`, `-h`, `help`, `--version`, `-V`, and `version`.

## Knowledge database: all six subcommands

Per-project knowledge is stored at `~/.monolex/work-wiki/{project-slug}.db`.

| Subcommand                               | Storage | Contract                                                                                                                                 |
| ---------------------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| `knowledge index [project]`              | Write   | Index research, prepare, prove, docs, and related artifact folders; `--gc` removes phantom documents and `--gc-dry-run` previews removal |
| `knowledge search <project> <query>`     | Read    | Return category-tagged ranked results from one project's knowledge DB                                                                    |
| `knowledge link <project> <repo-path>`   | Write   | Associate the project with the detected current repository hash and the supplied repository path                                         |
| `knowledge unlink <project> <repo-hash>` | Write   | Remove one project/repository association                                                                                                |
| `knowledge resolve [project]`            | Read    | Resolve an explicit project or auto-detect one for the current repository                                                                |
| `knowledge status [project]`             | Read    | Report document, entry, reference, tracked-folder, and linked-repository counts                                                          |

When `knowledge index` receives no project, 0.3.0 uses `monolex-006` as its compatibility default. Public automation should pass the intended project slug explicitly.

`artifacts` and `docs` have different jobs: `artifacts` inventories a project's files, while `docs` serves the reference embedded in the binary.

## Five ways to enter the same work

| Axis    | Commands                                        | Question                                            |
| ------- | ----------------------------------------------- | --------------------------------------------------- |
| Time    | `timeline`, `sessions`, `recent`                | When did related activity occur?                    |
| Intent  | `intent`                                        | What human-named purpose surrounded it?             |
| Layer   | `search --diff`, `--docs`, `--summary`, `--all` | Which kind of evidence should participate?          |
| File    | `file`, `diff`                                  | What is the biography of this path?                 |
| Project | `context`, `impact`, `patterns`, `all-projects` | Where does this work belong and how has it behaved? |

### `session` and `sessions` are different

* `session` reads real PTY session records and can show one session ID.
* `sessions` reconstructs work sessions from gaps between saved diffs. Its empty result means “no diff-save sessions,” not “no work happened.”

### `recent` and `timeline` are different

* `recent` is an action-layer feed across diff, watcher, git, and wiki for a recent hour window.
* `timeline` supports a query, layer filter, longer window, and `--all` to include conversation evidence.

## Cross-layer search

```bash theme={null}
work-wiki search "create_session"
work-wiki search "create_session" --diff
work-wiki search "create_session" --docs
work-wiki search "create_session" --summary
work-wiki search "create_session" --all --json
```

The default result can contain:

| Tag      | Evidence owner                                    |
| -------- | ------------------------------------------------- |
| `[D]`    | Saved diff rows                                   |
| `[K]`    | Wiki filesystem and per-project knowledge results |
| `[S]`    | Durable summary store                             |
| `[code]` | Monogram evidence returned through Monoflow       |
| `[git]`  | Monogit evidence returned through Monoflow        |
| `[conv]` | Conversation/PTY evidence added by `--all`        |

The current implementation reserves roughly 60% of the requested limit for knowledge results and 40% for Monoflow results before merging, sorting, and truncating. `--all` then admits conversation rows; it does not promise that every layer will survive the final limit.

## Status and writer health

`work-wiki status --json` includes ordinary layer metrics plus Monoflow topics, stale docs, broken chains, hub docs, document/code gaps, five layer-chaos components, overall score, quality delta, quality scenario, and per-layer ages.

The diff lane has a separate liveness contract. `status`, `recent`, `sessions`, and `patterns` warn when the Monoguard writer is dead so old rows cannot masquerade as a healthy current feed.

PTY instrumentation covers Monolex app PTY sessions. Work performed only in an external terminal can be absent from the PTY lane even when git, watcher, or document evidence exists.

## File biography boundary

The installed guide calls `work-wiki file` a “6-DB file biography.” The 0.3.0 output currently renders these evidence families:

* PTY activity and operations
* watcher event counts and types
* saved-diff count, additions, deletions, and first/last time
* Monogit commits that touched the path through `commit_symbols`
* Work Wiki markdown references to the basename

The profile label—read-only, hot, shrinking, active, tracked, or unknown—is a heuristic over those fields, not a correctness judgment.

## Convergence: code topic to knowledge coverage

`work-wiki convergence` reads Monoflow topics and searches the resolved project knowledge DB across four phases:

| Phase | Typical location | Meaning                                               |
| ----- | ---------------- | ----------------------------------------------------- |
| R     | `wip/research/`  | The problem or design space was investigated          |
| P     | `wip/prepare/`   | An implementation plan or preparation artifact exists |
| V     | `wip/prove/`     | A verification or proof artifact exists               |
| D     | `wiki/docs/`     | A final durable document exists                       |

The labels are coverage bands: `GAP` for zero, `WEAK` below 50%, `PART` below full coverage, and `FULL` at 100%. Coverage does not prove that the documents are correct or current.

## Read and write contract

| Writer surface              | Effect                                                                        |
| --------------------------- | ----------------------------------------------------------------------------- |
| `index [project]`           | Updates the Work Wiki artifact index                                          |
| `backfill`                  | Mutates saved-diff rows by linking them to commits                            |
| `knowledge index`           | Creates or updates a per-project knowledge DB under an exclusive stable lease |
| `knowledge link` / `unlink` | Mutates project/repository relationships                                      |
| `reindex`                   | Launches the Monoflow full cascade, then the knowledge writer                 |

The other inventory commands are query or diagnostic surfaces and open existing databases read-only where applicable.

In Work Wiki 0.3.0, `reindex` prints a warning when a child process exits unsuccessfully but still completes its own loop. Automation must inspect the child-step output; a zero exit from the wrapper alone is not proof that every lower layer refreshed.

## CLI and MCP boundary

Work Wiki 0.3.0 does not implement `--mcp-schema`; that argument exits non-zero as an unknown command. It is a CLI and Rust-library surface, while Monoflow provides the typed 24-command CLI-to-MCP schema.

Use [NIIA](/ai-clis/niia) for the integrated knowledge commands, or call `work-wiki` directly when you need the full inventory above.

## Continue through the stack

<CardGroup cols={3}>
  <Card title="Inspect temporal composition" icon="diagram-project" href="/ai-clis/monoflow">
    Follow topics, co-change, gaps, and the exact 24-command typed MCP boundary.
  </Card>

  <Card title="Prove the code edge" icon="magnifying-glass" href="/ai-clis/monogram/overview">
    Move from a Work Wiki code hit to definitions, callers, coupling, and deep semantic evidence.
  </Card>

  <Card title="Recall and orchestrate" icon="brain" href="/ai-clis/niia">
    NIIA joins Work Wiki knowledge with sessions, terminals, remote machines, and guarded OS control.
  </Card>
</CardGroup>
