@aopslabs/aops 0.3.31 → 0.3.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -3
- package/aops-assets-release/aops-assets.json.gz +0 -0
- package/aops-assets-release/disciplines/build-review-chat/SKILL.md +33 -0
- package/aops-assets-release/disciplines/coordinator-loop/SKILL.md +33 -0
- package/aops-assets-release/disciplines/design-first-consensus/SKILL.md +30 -0
- package/aops-assets-release/disciplines/solo-pm-loop/SKILL.md +31 -0
- package/aops-assets-release/docs/user-guides/agentspace-user-guide.md +384 -0
- package/aops-assets-release/docs/user-guides/aops-cli-user-guide.md +2067 -0
- package/aops-assets-release/docs/user-guides/chatv3-user-guide.md +500 -0
- package/aops-assets-release/docs/user-guides/docman-user-guide.md +1009 -0
- package/aops-assets-release/docs/user-guides/projectman-user-guide.md +763 -0
- package/aops-assets-release/docs/user-guides/tasker-user-guide.md +244 -0
- package/aops-assets-release/release.json +6 -0
- package/aops-assets-release/roles/coordinator/ROLE.md +28 -0
- package/aops-assets-release/roles/implementer/ROLE.md +27 -0
- package/aops-assets-release/roles/reviewer/ROLE.md +27 -0
- package/aops-assets-release/skills/aops/SKILL.md +112 -0
- package/aops-assets-release/skills/aops-bootstrapper-authoring/SKILL.md +245 -0
- package/aops-assets-release/skills/aops-cli-agentspace/SKILL.md +186 -0
- package/aops-assets-release/skills/aops-cli-board-lifecycle/SKILL.md +64 -0
- package/aops-assets-release/skills/aops-cli-chat/SKILL.md +204 -0
- package/aops-assets-release/skills/aops-cli-collab/SKILL.md +42 -0
- package/aops-assets-release/skills/aops-cli-core/SKILL.md +219 -0
- package/aops-assets-release/skills/aops-cli-discuss/SKILL.md +172 -0
- package/aops-assets-release/skills/aops-cli-docman/SKILL.md +192 -0
- package/aops-assets-release/skills/aops-cli-fileman/SKILL.md +169 -0
- package/aops-assets-release/skills/aops-cli-mission/SKILL.md +128 -0
- package/aops-assets-release/skills/aops-cli-operator-brief/SKILL.md +67 -0
- package/aops-assets-release/skills/aops-cli-projectman/SKILL.md +235 -0
- package/aops-assets-release/skills/aops-cli-sugar-authoring/SKILL.md +188 -0
- package/aops-assets-release/skills/aops-cli-tasker/SKILL.md +108 -0
- package/aops-assets-release/skills/aops-cli-tooling-agent/SKILL.md +112 -0
- package/aops-assets-release/skills/aops-cli-view/SKILL.md +210 -0
- package/aops-assets-release/skills/aops-collaborative-work/SKILL.md +304 -0
- package/aops-assets-release/skills/aops-interactive/SKILL.md +70 -0
- package/aops-assets-release/skills/aops-loop-interactive/SKILL.md +314 -0
- package/aops-assets-release/skills/aops-working-disciplines/SKILL.md +310 -0
- package/aops-assets-release/skills/feature-retirement-flow/SKILL.md +126 -0
- package/assets/skills/aops-install/SKILL.md +18 -17
- package/dist/commands/assets.js +93 -1264
- package/dist/commands/community-server.js +27 -8
- package/dist/commands/community-setup.js +1 -2
- package/dist/commands/discuss.js +1 -1
- package/dist/commands/doc.js +88 -27
- package/dist/commands/docs.js +68 -0
- package/dist/commands/global-update.js +28 -0
- package/dist/commands/init.js +3 -1
- package/dist/commands/loop.js +6379 -0
- package/dist/commands/memory.js +2 -1
- package/dist/commands/pm/index.js +11 -9
- package/dist/commands/pm/projectman.js +33 -2
- package/dist/commands/project.js +6 -6
- package/dist/commands/prompt.js +1 -1
- package/dist/commands/repo-sync.js +92 -27
- package/dist/commands/runner.js +257 -0
- package/dist/commands/skill.js +1 -1
- package/dist/commands/start.js +1 -1
- package/dist/commands/tasker.js +361 -0
- package/dist/commands/view.js +53 -9
- package/dist/lib/commercial-setup-readiness-adapter.js +0 -1
- package/dist/lib/community-migration-snapshot.js +7 -9
- package/dist/lib/community-native-database-recovery.js +5 -14
- package/dist/lib/community-native-lifecycle.js +13 -0
- package/dist/lib/setup-agent-assets-bridge.js +28 -148
- package/dist/lib/setup-agent-assets-release.js +16 -44
- package/dist/lib/setup-init-orchestrator.js +11 -15
- package/dist/lib/simple-agent-assets.js +447 -0
- package/dist/lib/user-guide-sections.js +488 -0
- package/dist/main.js +10 -2
- package/dist/seeds/agents-md.js +3 -3
- package/dist/utils/agents-md.js +1 -1
- package/dist/utils/guide-paths.js +7 -7
- package/dist/utils/hosted-workspace.js +2 -1
- package/dist/utils/repo-first-storage.js +26 -1
- package/dist/utils/session-state.js +2 -7
- package/launchers/aops-cockpit.sh +0 -0
- package/launchers/aops-server.sh +0 -0
- package/package.json +67 -35
- package/THIRD_PARTY_NOTICES +0 -16169
- package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/SKILL.md +0 -47
- package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/references/agentspace/SKILL.md +0 -72
- package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/references/aops-cli-core/SKILL.md +0 -110
- package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/references/chatv3/SKILL.md +0 -59
- package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/references/collaborative-work/SKILL.md +0 -81
- package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/references/discuss/SKILL.md +0 -66
- package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/references/docman/SKILL.md +0 -75
- package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/references/projectman/SKILL.md +0 -92
- package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/references/sys/SKILL.md +0 -36
- package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/references/view/SKILL.md +0 -58
- package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/references/working-disciplines/SKILL.md +0 -66
- package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/user-guides/agent-assets.md +0 -81
- package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/user-guides/agentspace.md +0 -183
- package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/user-guides/aops-cli.md +0 -1108
- package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/user-guides/aops-system.md +0 -102
- package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/user-guides/chatv3.md +0 -113
- package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/user-guides/docman.md +0 -223
- package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/user-guides/projectman.md +0 -233
- package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/user-guides/sys.md +0 -94
- package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/user-guides/working-disciplines.md +0 -482
- package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/manifest.json +0 -117
- package/agent-assets-release/agent-assets/gateway/aops/SKILL.md +0 -14
- package/agent-assets-release/agent-assets/inventory.json +0 -29
- package/agent-assets-release/agent-assets/projection.json +0 -8
- package/agent-assets-release/agent-assets-release.json +0 -171
- package/agent-assets-release/agent-assets-release.sigstore.json +0 -67
- package/assets/agent-assets/core/SKILL.md +0 -47
- package/assets/agent-assets/core/references/agentspace/SKILL.md +0 -72
- package/assets/agent-assets/core/references/aops-cli-core/SKILL.md +0 -110
- package/assets/agent-assets/core/references/chatv3/SKILL.md +0 -59
- package/assets/agent-assets/core/references/collaborative-work/SKILL.md +0 -81
- package/assets/agent-assets/core/references/discuss/SKILL.md +0 -66
- package/assets/agent-assets/core/references/docman/SKILL.md +0 -75
- package/assets/agent-assets/core/references/projectman/SKILL.md +0 -92
- package/assets/agent-assets/core/references/sys/SKILL.md +0 -36
- package/assets/agent-assets/core/references/view/SKILL.md +0 -58
- package/assets/agent-assets/core/references/working-disciplines/SKILL.md +0 -66
- package/assets/agent-assets/core/user-guides/agent-assets.md +0 -81
- package/assets/agent-assets/core/user-guides/agentspace.md +0 -183
- package/assets/agent-assets/core/user-guides/aops-cli.md +0 -1108
- package/assets/agent-assets/core/user-guides/aops-system.md +0 -102
- package/assets/agent-assets/core/user-guides/chatv3.md +0 -113
- package/assets/agent-assets/core/user-guides/docman.md +0 -223
- package/assets/agent-assets/core/user-guides/projectman.md +0 -233
- package/assets/agent-assets/core/user-guides/sys.md +0 -94
- package/assets/agent-assets/core/user-guides/working-disciplines.md +0 -482
- package/assets/agent-assets/gateway/aops/SKILL.md +0 -14
- package/dist/lib/agent-assets/gateway.js +0 -15
- package/dist/lib/agent-assets/guards.js +0 -23
- package/dist/lib/agent-assets/hosted-discovery.js +0 -148
- package/dist/lib/agent-assets/hosted-package-input.js +0 -154
- package/dist/lib/agent-assets/legacy-pointer-migration.js +0 -677
- package/dist/lib/agent-assets/native-fs.js +0 -589
- package/dist/lib/agent-assets/roots.js +0 -45
- package/dist/lib/agent-assets/runtime-binding-reader.js +0 -545
- package/dist/lib/agent-assets/runtime-targets.js +0 -50
- package/dist/lib/agent-assets/store-reader.js +0 -1212
- package/dist/lib/agent-assets/store-writer.js +0 -1484
- package/native/bin/darwin-arm64/aops-agent-assets-fs +0 -0
- package/native/bin/darwin-x64/aops-agent-assets-fs +0 -0
- package/native/bin/linux-arm64/aops-agent-assets-fs +0 -0
- package/native/bin/linux-x64/aops-agent-assets-fs +0 -0
- package/native/bin/win32-x64/aops-agent-assets-fs.exe +0 -0
- package/native/manifest.json +0 -49
- package/native/qualifications/win32-x64.json +0 -23
- package/native/tui/darwin-arm64/aops-tui +0 -0
- package/native/tui/linux-x64/aops-tui +0 -0
- package/native/tui/win32-x64/aops-tui.exe +0 -0
|
@@ -0,0 +1,1009 @@
|
|
|
1
|
+
# Docman User Guide
|
|
2
|
+
|
|
3
|
+
_Release Notes:_ Adds the tested safe-delete recipe, stale-mirror semantics, validation-error contract, and generated CLI catalog entry.
|
|
4
|
+
|
|
5
|
+
## 1 Agent fast path
|
|
6
|
+
|
|
7
|
+
### 1.1 Overview
|
|
8
|
+
|
|
9
|
+
When an agent receives a Docman task, use this sequence before reading the
|
|
10
|
+
entire guide:
|
|
11
|
+
|
|
12
|
+
1. Read `aops doc <group> <command> --help` for the command's actual flags.
|
|
13
|
+
2. If the repository has a mirror, find the smallest relevant fragment first
|
|
14
|
+
with `aops view docs`, `aops view doc-page`, or `aops doc search --local`.
|
|
15
|
+
3. When a hosted capability is required, do not guess the tool name or input:
|
|
16
|
+
run `aops agent tools --domain docman --summary --json`, then
|
|
17
|
+
`aops agent schema --tool <tool-id> --summary --json`.
|
|
18
|
+
4. Write canonical state to the server. Never hand-edit `.aops/docman/**`.
|
|
19
|
+
5. For a single-page **content** change, fork the current version with
|
|
20
|
+
`clone_all`, fork the page version with `draft-save`, and atomically switch
|
|
21
|
+
the current/published pointer with `set-current-version` instead of using a
|
|
22
|
+
full Markdown import. If section/page metadata or the outline changes, do
|
|
23
|
+
not assume cloning isolates shared entities; use a clean version with a
|
|
24
|
+
guarded import or an explicit new-entity flow.
|
|
25
|
+
6. After writing, run the `index build`, `summary build`, `search`, `answer`,
|
|
26
|
+
and `mirror pull` gates.
|
|
27
|
+
|
|
28
|
+
The package launcher is named `aops-cli`; the installed public launcher may be
|
|
29
|
+
named `aops`. Both names refer to the same CLI surface in this guide.
|
|
30
|
+
|
|
31
|
+
## 2 Ownership model
|
|
32
|
+
|
|
33
|
+
### 2.1 Overview
|
|
34
|
+
|
|
35
|
+
`docman` owns:
|
|
36
|
+
|
|
37
|
+
1. document creation
|
|
38
|
+
2. document metadata updates
|
|
39
|
+
3. the version, section, page, page-version, and link graph
|
|
40
|
+
4. saved-version retrieval
|
|
41
|
+
5. deterministic answer/search/source/publish operations
|
|
42
|
+
|
|
43
|
+
`docman` does not own:
|
|
44
|
+
|
|
45
|
+
1. durable memory or project summaries
|
|
46
|
+
2. planning, sprint, or task execution truth
|
|
47
|
+
3. prompt, resource, or skill ownership
|
|
48
|
+
|
|
49
|
+
In short:
|
|
50
|
+
|
|
51
|
+
1. `projectman` = execution truth
|
|
52
|
+
2. `agentspace` = context truth
|
|
53
|
+
3. `docman` = canonical written knowledge truth
|
|
54
|
+
|
|
55
|
+
### 2.2 AOPS CLI skill routing
|
|
56
|
+
|
|
57
|
+
#### 2.2.1 Overview
|
|
58
|
+
|
|
59
|
+
The hosted operator playbook for Docman is the `aops-cli-docman` skill.
|
|
60
|
+
|
|
61
|
+
| Need | Canonical source |
|
|
62
|
+
|---------|------------------|
|
|
63
|
+
| exact command flags | `aops-cli doc --help` and nested help surfaces |
|
|
64
|
+
| document graph semantics | this file and `architecture.md` |
|
|
65
|
+
| operator guard/playbook | hosted `aops-cli-docman` |
|
|
66
|
+
| published/searchable projection | `slug:aops` hosted Docman current version |
|
|
67
|
+
| public distribution copy | `aops/assets/docs/user-guides/docman-user-guide.md` |
|
|
68
|
+
|
|
69
|
+
Development authoring truth is the `slug:aops` Docman record on AOPS's
|
|
70
|
+
canonical server. The repository-local `USER_GUIDE.md` is a source-parity and
|
|
71
|
+
domain-development reference; `.aops/docman/**` is a read-only mirror/cache.
|
|
72
|
+
When preparing a public release, materialize the published/current Docman
|
|
73
|
+
version into the physical asset file. Public assets are consumed as files on
|
|
74
|
+
user machines; do not automatically import every global public asset into each
|
|
75
|
+
user's canonical Docman server.
|
|
76
|
+
|
|
77
|
+
## 3 Core model
|
|
78
|
+
|
|
79
|
+
### 3.1 Overview
|
|
80
|
+
|
|
81
|
+
The Docman graph is not document-only. Its primary chain is:
|
|
82
|
+
|
|
83
|
+
1. `document`
|
|
84
|
+
2. `document-version`
|
|
85
|
+
3. `section`
|
|
86
|
+
4. `page`
|
|
87
|
+
5. `page-version`
|
|
88
|
+
6. `document-section-link`
|
|
89
|
+
7. `section-page-link`
|
|
90
|
+
|
|
91
|
+
Rules:
|
|
92
|
+
|
|
93
|
+
1. A `section` is a container, not the body owner.
|
|
94
|
+
2. Authored source lives on `page-version`.
|
|
95
|
+
3. `document-section-link` owns the document tree.
|
|
96
|
+
4. `section-page-link` owns reusable flat section-page membership.
|
|
97
|
+
5. Root pages are supported.
|
|
98
|
+
6. `page-version.format` accepts only `md`, `mdx`, or `text`.
|
|
99
|
+
7. `document-version.contentMode` determines the document shape:
|
|
100
|
+
- `structured`: section/page graph; `fileExtension=md`
|
|
101
|
+
- `text-file`: one root page; sections and a second page are forbidden
|
|
102
|
+
8. `fileExtension` is a persistent file identity separate from source format.
|
|
103
|
+
Write it in lowercase without a leading dot (`cs`, `txt`). Uppercase input
|
|
104
|
+
is not normalized and is rejected fail-closed.
|
|
105
|
+
|
|
106
|
+
## 4 Using Docman through the AOPS CLI
|
|
107
|
+
|
|
108
|
+
### 4.1 Overview
|
|
109
|
+
|
|
110
|
+
`aops-cli doc` accesses Docman through the hosted AOPS plane.
|
|
111
|
+
|
|
112
|
+
There are two primary surfaces:
|
|
113
|
+
|
|
114
|
+
1. authoring / structure:
|
|
115
|
+
- `doc group create|update|delete`
|
|
116
|
+
- `doc group list|get`
|
|
117
|
+
- `doc create`
|
|
118
|
+
- `doc list|get|update`
|
|
119
|
+
- `doc update`
|
|
120
|
+
- `doc version create`
|
|
121
|
+
- `doc version list|get|update`
|
|
122
|
+
- `doc set-current-version`
|
|
123
|
+
- `doc section create`
|
|
124
|
+
- `doc section update|copy|unlink`
|
|
125
|
+
- `doc section list|get`
|
|
126
|
+
- `doc page create`
|
|
127
|
+
- `doc page update|copy|move|unlink|membership-unlink`
|
|
128
|
+
- `doc page list|get`
|
|
129
|
+
- `doc page draft-save`
|
|
130
|
+
- `doc page-version list|get|update`
|
|
131
|
+
- `doc source-file save`
|
|
132
|
+
- `doc link section`
|
|
133
|
+
- `doc link page`
|
|
134
|
+
- `doc order sections`
|
|
135
|
+
- `doc order pages`
|
|
136
|
+
- `doc outline get`
|
|
137
|
+
- `doc import --from-markdown`
|
|
138
|
+
2. retrieval / publish:
|
|
139
|
+
- `doc index build`
|
|
140
|
+
- `doc summary build`
|
|
141
|
+
- `doc search`
|
|
142
|
+
- `doc scope search`
|
|
143
|
+
- `doc scope answer`
|
|
144
|
+
- `doc answer`
|
|
145
|
+
- `doc source`
|
|
146
|
+
- `doc publish`
|
|
147
|
+
- `doc mirror pull`
|
|
148
|
+
- `doc mirror push`
|
|
149
|
+
|
|
150
|
+
## 5 Authoring cookbook
|
|
151
|
+
|
|
152
|
+
### 5.1 Overview
|
|
153
|
+
|
|
154
|
+
Canonical authoring-read loop:
|
|
155
|
+
|
|
156
|
+
1. If needed, establish the classification tree with `doc group create|update|delete`.
|
|
157
|
+
2. `doc create`
|
|
158
|
+
3. `doc version create`
|
|
159
|
+
4. `doc section create`
|
|
160
|
+
5. `doc page create`
|
|
161
|
+
6. `doc outline get`
|
|
162
|
+
7. `doc set-current-version`
|
|
163
|
+
8. `doc index build` and `doc summary build`
|
|
164
|
+
9. `doc answer|search|source|publish`
|
|
165
|
+
10. `doc mirror pull`
|
|
166
|
+
|
|
167
|
+
### 5.2 Create a canonical Docman version from existing Markdown
|
|
168
|
+
|
|
169
|
+
#### 5.2.1 Overview
|
|
170
|
+
|
|
171
|
+
If a Markdown file is only a temporary source or draft and the Docman server
|
|
172
|
+
will become canonical truth, `doc mirror push` is not the default path. When
|
|
173
|
+
the section/page graph must be preserved or designed manually, create the
|
|
174
|
+
document as Docman entities:
|
|
175
|
+
|
|
176
|
+
1. Find or create the group.
|
|
177
|
+
2. Set document metadata with `doc create` or `doc update`.
|
|
178
|
+
3. Open a new `document-version`.
|
|
179
|
+
4. Build the graph from the H2/H3 structure with `section create` and
|
|
180
|
+
`page create`.
|
|
181
|
+
5. Verify section and page counts with `outline get`.
|
|
182
|
+
6. Run `index build` and `summary build`.
|
|
183
|
+
7. Verify retrieval with `search` and `answer`.
|
|
184
|
+
8. Run `doc mirror pull` for repository-local reads.
|
|
185
|
+
9. Delete temporary repository Markdown only after verifying the mirror.
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
aops-cli doc group list --json
|
|
189
|
+
|
|
190
|
+
aops-cli doc update \
|
|
191
|
+
--id <document-id> \
|
|
192
|
+
--title "UI System v2" \
|
|
193
|
+
--slug ui-systemv2 \
|
|
194
|
+
--group-id <group-id> \
|
|
195
|
+
--status published \
|
|
196
|
+
--visibility internal \
|
|
197
|
+
--project-name eops \
|
|
198
|
+
--apply \
|
|
199
|
+
--json
|
|
200
|
+
|
|
201
|
+
aops-cli doc version create \
|
|
202
|
+
--document-id <document-id> \
|
|
203
|
+
--version <next-version> \
|
|
204
|
+
--status published \
|
|
205
|
+
--init-mode clean \
|
|
206
|
+
--project-name eops \
|
|
207
|
+
--apply \
|
|
208
|
+
--json
|
|
209
|
+
|
|
210
|
+
aops-cli doc section create \
|
|
211
|
+
--document-version-id <docver-id> \
|
|
212
|
+
--title "Navigation" \
|
|
213
|
+
--position 0 \
|
|
214
|
+
--apply \
|
|
215
|
+
--json
|
|
216
|
+
|
|
217
|
+
aops-cli doc section create \
|
|
218
|
+
--document-version-id <docver-id> \
|
|
219
|
+
--parent-link-id <parent-document-section-link-id> \
|
|
220
|
+
--title "Top Thin Bar" \
|
|
221
|
+
--position 0 \
|
|
222
|
+
--apply \
|
|
223
|
+
--json
|
|
224
|
+
|
|
225
|
+
aops-cli doc page create \
|
|
226
|
+
--document-version-id <docver-id> \
|
|
227
|
+
--section-id <section-id> \
|
|
228
|
+
--title "Top Thin Bar" \
|
|
229
|
+
--format md \
|
|
230
|
+
--content '@./top-thin-bar.md' \
|
|
231
|
+
--apply \
|
|
232
|
+
--json
|
|
233
|
+
|
|
234
|
+
aops-cli doc outline get --document-version-id <docver-id> --json
|
|
235
|
+
aops-cli doc index build --document-version-id <docver-id> --project-name eops --json
|
|
236
|
+
aops-cli doc summary build --document-version-id <docver-id> --project-name eops --json
|
|
237
|
+
aops-cli doc search --document-version-id <docver-id> --q "top thin bar" --ensure summary --json
|
|
238
|
+
aops-cli doc answer --document-version-id <docver-id> --q "How should panels work?" --ensure summary --json
|
|
239
|
+
aops-cli doc mirror pull --group-uid <group-uid> --out-dir .aops/docman --target markdown --project-name eops --apply --json
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
When one Markdown file needs a heading-graph import, use the dedicated import
|
|
243
|
+
surface:
|
|
244
|
+
|
|
245
|
+
```bash
|
|
246
|
+
aops-cli doc import \
|
|
247
|
+
--from-markdown \
|
|
248
|
+
--document-version-id <clean-docver-id> \
|
|
249
|
+
--source ./ui-system-v2.md \
|
|
250
|
+
--baseline ./.aops/docman/architecture/ui-system-v2.md \
|
|
251
|
+
--guard-target "Target Section Or Page" \
|
|
252
|
+
--dry-run \
|
|
253
|
+
--json
|
|
254
|
+
|
|
255
|
+
aops-cli doc import \
|
|
256
|
+
--from-markdown \
|
|
257
|
+
--document-version-id <clean-docver-id> \
|
|
258
|
+
--source ./ui-system-v2.md \
|
|
259
|
+
--baseline ./.aops/docman/architecture/ui-system-v2.md \
|
|
260
|
+
--guard-target "Target Section Or Page" \
|
|
261
|
+
--synthesize-overview-pages \
|
|
262
|
+
--dry-run \
|
|
263
|
+
--json
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
Heading import MVP rules:
|
|
267
|
+
|
|
268
|
+
1. `doc import --from-markdown` is the single-file authoring/migration surface;
|
|
269
|
+
multi-file batch import is deferred to a later sprint.
|
|
270
|
+
2. H1 is excluded from the graph; H2/H3 become `section`, and H4+ become
|
|
271
|
+
`page`.
|
|
272
|
+
3. Direct body content under H2/H3 is not converted into a page by default;
|
|
273
|
+
the import returns a `section-direct-body-ignored` warning. To preserve that
|
|
274
|
+
body, repeat the dry run with `--synthesize-overview-pages` and the same
|
|
275
|
+
`--baseline` / `--guard-target` guards. That flag imports the body as an
|
|
276
|
+
`Overview` page under the corresponding section. In CLI JSON, warning codes
|
|
277
|
+
appear under `result.summary.warnings[].code` without a baseline, or under
|
|
278
|
+
`result.import.summary.warnings[].code` with a baseline guard.
|
|
279
|
+
4. The default `existingGraphPolicy=error` requires a clean version. Append or
|
|
280
|
+
replace intent requires explicit `--append-existing-graph` or
|
|
281
|
+
`--replace-existing-graph` flags.
|
|
282
|
+
5. This behavior does not extend `doc mirror push`; it retains flat root
|
|
283
|
+
Markdown migration/snapshot semantics.
|
|
284
|
+
|
|
285
|
+
Full-import guardrail:
|
|
286
|
+
|
|
287
|
+
1. For a one-section or one-page change in an existing document, full import
|
|
288
|
+
should be the last choice. Use `clone_all`, targeted page/section CRUD,
|
|
289
|
+
`doc set-current-version`, and then `doc mirror pull` first.
|
|
290
|
+
2. When a full Markdown import is required, pass the previous materialized
|
|
291
|
+
Markdown as `--baseline <path>` and inspect `result.baselineGuard` in the
|
|
292
|
+
`--dry-run --json` output.
|
|
293
|
+
3. Use `--guard-target <heading>` only for the heading path/title expected to
|
|
294
|
+
change. If the baseline guard finds unrelated missing, added, changed, or
|
|
295
|
+
truncated body deltas, the `--apply` flow is blocked without `--confirm`.
|
|
296
|
+
4. `--confirm` is not a way to silence the guard. It is a deliberate override
|
|
297
|
+
after the operator reviews the full-import delta.
|
|
298
|
+
|
|
299
|
+
Notes:
|
|
300
|
+
|
|
301
|
+
1. `.aops/docman/**` is a read-only mirror, not canonical source.
|
|
302
|
+
2. `doc mirror pull` produces a materialized copy from hosted Docman and writes
|
|
303
|
+
the index.
|
|
304
|
+
3. If the repository config has no slug, use `--project-name` instead of
|
|
305
|
+
`--project-slug`.
|
|
306
|
+
4. `doc mirror push` is only a migration/snapshot utility for importing root
|
|
307
|
+
Markdown files; it does not replace manual section/page version authoring.
|
|
308
|
+
5. When building nested sections, `--parent-link-id` is the parent
|
|
309
|
+
`document-section-link` id, not the parent section id. Take the link id from
|
|
310
|
+
the create/link result, attach the child section under it, and verify the
|
|
311
|
+
hierarchy with `outline get`.
|
|
312
|
+
6. H2/H3 rendering in a Markdown preview is not the canonical graph. Compose,
|
|
313
|
+
preview, edit, and CLI outline must align with the same saved
|
|
314
|
+
section/page/link graph. Automatic nested-graph generation from headings is
|
|
315
|
+
a separate domain-chain import/migration operation whose dedicated surface
|
|
316
|
+
is `doc import --from-markdown`.
|
|
317
|
+
|
|
318
|
+
### 5.3 Editing an existing document: prefer section/page CRUD
|
|
319
|
+
|
|
320
|
+
#### 5.3.1 Overview
|
|
321
|
+
|
|
322
|
+
When updating an existing Docman document, do not first regenerate the whole
|
|
323
|
+
document as temporary Markdown and import a new version with `mirror push`.
|
|
324
|
+
The canonical graph consists of the server-side `section`, `page`,
|
|
325
|
+
`page-version`, `document-section-link`, and `section-page-link` records. When
|
|
326
|
+
the target record is known, use direct CRUD sugar.
|
|
327
|
+
|
|
328
|
+
Find the current identifiers with small reads first:
|
|
329
|
+
|
|
330
|
+
```bash
|
|
331
|
+
aops doc list --project-slug <slug> --slug <document-slug> --json
|
|
332
|
+
aops doc version list --project-slug <slug> --document-id <document-id> --json
|
|
333
|
+
aops doc outline get --project-slug <slug> --document-version-id <current-version-id> --titles-only --depth 3 --json
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
Safe single-page **content** revision in a published/current document:
|
|
337
|
+
|
|
338
|
+
```bash
|
|
339
|
+
aops doc version create \
|
|
340
|
+
--project-slug <slug> \
|
|
341
|
+
--document-id <document-id> \
|
|
342
|
+
--version <next-version> \
|
|
343
|
+
--status draft \
|
|
344
|
+
--init-mode clone_all \
|
|
345
|
+
--source-version-id <current-version-id> \
|
|
346
|
+
--apply --json
|
|
347
|
+
|
|
348
|
+
aops doc page draft-save \
|
|
349
|
+
--project-slug <slug> \
|
|
350
|
+
--page-version-id <cloned-page-version-id> \
|
|
351
|
+
--document-link-id <cloned-document-link-id> \
|
|
352
|
+
--content @./updated-page.md \
|
|
353
|
+
--apply --json
|
|
354
|
+
|
|
355
|
+
aops doc set-current-version \
|
|
356
|
+
--project-slug <slug> \
|
|
357
|
+
--document-id <document-id> \
|
|
358
|
+
--version-id <new-version-id> \
|
|
359
|
+
--expected-previous-version-id <current-version-id> \
|
|
360
|
+
--publish-now \
|
|
361
|
+
--apply --json
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
`set-current-version` normally publishes the target version while making it
|
|
365
|
+
current and writes `publishedAt` using server time. Use `--no-publish` to switch
|
|
366
|
+
only the current pointer without changing status or `publishedAt`. Use
|
|
367
|
+
`--no-publish-now --published-at <iso>` for a caller-provided `publishedAt`.
|
|
368
|
+
Keep the `--expected-previous-version-id` guard to bind the former current id
|
|
369
|
+
during a race.
|
|
370
|
+
|
|
371
|
+
When needed, `draft-save` forks a locked page version or one shared by other
|
|
372
|
+
links. Pass `--document-link-id` so the forked version becomes visible in this
|
|
373
|
+
document tree. Read back `mode=fork`, the new `pageVersionId`, and the
|
|
374
|
+
`relinkedDocumentLinkId` from the result.
|
|
375
|
+
|
|
376
|
+
`clone_all` creates only new `document-section-link` rows; it does not
|
|
377
|
+
automatically clone `section`, `page`, `page-version`, or `section-page-link`
|
|
378
|
+
records. Therefore, running `section update`, `page update`, `page move`,
|
|
379
|
+
`page membership-unlink`, or `order pages` after cloning may retroactively
|
|
380
|
+
affect the previous published version. For a content-only revision, use the
|
|
381
|
+
`draft-save` fork flow above. For title, section-structure, or membership
|
|
382
|
+
changes, use a clean version with guarded full import or an explicit
|
|
383
|
+
new/cloned-entity flow, and verify that the previous version's compose hash is
|
|
384
|
+
unchanged.
|
|
385
|
+
|
|
386
|
+
```bash
|
|
387
|
+
aops-cli doc section update --id <section-id> --title "New section title" --apply --json
|
|
388
|
+
aops-cli doc section copy --source-section-id <section-id> --target-document-version-id <docver-id> --reuse-pages --apply --json
|
|
389
|
+
aops-cli doc section unlink --link-id <document-section-link-id> --apply --json
|
|
390
|
+
|
|
391
|
+
aops-cli doc page update --id <page-id> --title "New page title" --apply --json
|
|
392
|
+
aops-cli doc page draft-save --page-version-id <pagever-id> --content @./page.md --apply --json
|
|
393
|
+
aops-cli doc page copy --source-page-id <page-id> --target-section-id <section-id> --reuse-page --apply --json
|
|
394
|
+
aops-cli doc page move --link-id <section-page-link-id> --target-section-id <section-id> --position 2 --apply --json
|
|
395
|
+
aops-cli doc page unlink --link-id <document-section-link-id> --apply --json
|
|
396
|
+
aops-cli doc page membership-unlink --link-id <section-page-link-id> --apply --json
|
|
397
|
+
|
|
398
|
+
aops-cli doc page-version update --id <pagever-id> --status published --apply --json
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
Rules:
|
|
402
|
+
|
|
403
|
+
1. `section update` changes metadata; a section does not own body content.
|
|
404
|
+
2. `page update` changes page metadata. Use `doc page draft-save` for content
|
|
405
|
+
or format changes.
|
|
406
|
+
3. `page-version update` performs only `draft|published|archived` status
|
|
407
|
+
transitions; it does not accept content.
|
|
408
|
+
4. `section copy` reuses page-version links by default. Pass `--clone-pages`
|
|
409
|
+
explicitly when a new page/page-version copy is required.
|
|
410
|
+
5. `page copy` links the selected page version, or the page version with the
|
|
411
|
+
highest numeric version, to the target section by default. Pass
|
|
412
|
+
`--clone-page` explicitly when a new page/page-version is required.
|
|
413
|
+
6. `page unlink` deletes the `kind=page` document-outline link produced by
|
|
414
|
+
`page create`. Use the separate `page membership-unlink` command for a
|
|
415
|
+
reusable `section-page-link`; do not substitute one link kind for the other.
|
|
416
|
+
On a published version, use these raw CRUD commands only after proving that
|
|
417
|
+
no other version shares the target entity/link.
|
|
418
|
+
7. Verify post-edit saved-version visibility with
|
|
419
|
+
`outline get --titles-only --depth <n>`, `index build`, `summary build`,
|
|
420
|
+
`search`, and `answer`.
|
|
421
|
+
8. Do not use only a mutable draft `pageVersionId` in a review request. Add the
|
|
422
|
+
`contentHash` (`sha256:<hex>`) from a `document.compose.fetch` or
|
|
423
|
+
`document.publish.materialize` readback to the review reference together
|
|
424
|
+
with `documentVersionId`/`pageVersionId`. The review result must reference
|
|
425
|
+
the same hash. If the draft is saved again, the hash changes; the prior
|
|
426
|
+
acceptance no longer covers the new content, so a new review or re-review is
|
|
427
|
+
required.
|
|
428
|
+
|
|
429
|
+
### 5.4 Create a group
|
|
430
|
+
|
|
431
|
+
#### 5.4.1 Overview
|
|
432
|
+
|
|
433
|
+
```bash
|
|
434
|
+
aops-cli doc group create \
|
|
435
|
+
--title "Guides" \
|
|
436
|
+
--apply \
|
|
437
|
+
--json
|
|
438
|
+
```
|
|
439
|
+
|
|
440
|
+
### 5.5 Inspect a group
|
|
441
|
+
|
|
442
|
+
#### 5.5.1 Overview
|
|
443
|
+
|
|
444
|
+
```bash
|
|
445
|
+
aops-cli doc group list --json
|
|
446
|
+
aops-cli doc group get --id <group-id> --json
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
### 5.6 Create a document
|
|
450
|
+
|
|
451
|
+
#### 5.6.1 Overview
|
|
452
|
+
|
|
453
|
+
```bash
|
|
454
|
+
aops-cli doc create \
|
|
455
|
+
--title "Enterprise Resource Management Datasheet" \
|
|
456
|
+
--summary "Platform datasheet" \
|
|
457
|
+
--apply \
|
|
458
|
+
--json
|
|
459
|
+
```
|
|
460
|
+
|
|
461
|
+
### 5.7 Open a version
|
|
462
|
+
|
|
463
|
+
#### 5.7.1 Overview
|
|
464
|
+
|
|
465
|
+
```bash
|
|
466
|
+
aops-cli doc version create \
|
|
467
|
+
--document-id <doc-id> \
|
|
468
|
+
--version 1 \
|
|
469
|
+
--status draft \
|
|
470
|
+
--apply \
|
|
471
|
+
--json
|
|
472
|
+
```
|
|
473
|
+
|
|
474
|
+
Note:
|
|
475
|
+
|
|
476
|
+
1. The Docman document-version surface requires an explicit version in this
|
|
477
|
+
flow.
|
|
478
|
+
2. The auto-next-version ergonomics available in prompt and skill sugar are
|
|
479
|
+
not exposed in Docman.
|
|
480
|
+
|
|
481
|
+
### 5.8 Create a section and link it to the outline
|
|
482
|
+
|
|
483
|
+
#### 5.8.1 Overview
|
|
484
|
+
|
|
485
|
+
```bash
|
|
486
|
+
aops-cli doc section create \
|
|
487
|
+
--document-version-id <docver-id> \
|
|
488
|
+
--title "Overview" \
|
|
489
|
+
--apply \
|
|
490
|
+
--json
|
|
491
|
+
```
|
|
492
|
+
|
|
493
|
+
### 5.9 Create a page and save its first draft
|
|
494
|
+
|
|
495
|
+
#### 5.9.1 Overview
|
|
496
|
+
|
|
497
|
+
```bash
|
|
498
|
+
aops-cli doc page create \
|
|
499
|
+
--document-version-id <docver-id> \
|
|
500
|
+
--section-id <section-id> \
|
|
501
|
+
--title "Startup Behavior" \
|
|
502
|
+
--format md \
|
|
503
|
+
--content @./startup.md \
|
|
504
|
+
--apply \
|
|
505
|
+
--json
|
|
506
|
+
```
|
|
507
|
+
|
|
508
|
+
### 5.10 Link an existing page version under a section
|
|
509
|
+
|
|
510
|
+
#### 5.10.1 Overview
|
|
511
|
+
|
|
512
|
+
```bash
|
|
513
|
+
aops-cli doc link page \
|
|
514
|
+
--section-id <section-id> \
|
|
515
|
+
--page-version-id <pagever-id> \
|
|
516
|
+
--apply \
|
|
517
|
+
--json
|
|
518
|
+
```
|
|
519
|
+
|
|
520
|
+
### 5.11 Update ordering
|
|
521
|
+
|
|
522
|
+
#### 5.11.1 Overview
|
|
523
|
+
|
|
524
|
+
```bash
|
|
525
|
+
aops-cli doc order sections \
|
|
526
|
+
--document-version-id <docver-id> \
|
|
527
|
+
--update '{"linkId":"dsl-1","position":0}' \
|
|
528
|
+
--update '{"linkId":"dsl-2","position":1}' \
|
|
529
|
+
--apply \
|
|
530
|
+
--json
|
|
531
|
+
|
|
532
|
+
aops-cli doc order pages \
|
|
533
|
+
--section-id <section-id> \
|
|
534
|
+
--update '{"linkId":"spl-1","position":0}' \
|
|
535
|
+
--apply \
|
|
536
|
+
--json
|
|
537
|
+
```
|
|
538
|
+
|
|
539
|
+
### 5.12 Inspect structure
|
|
540
|
+
|
|
541
|
+
#### 5.12.1 Overview
|
|
542
|
+
|
|
543
|
+
```bash
|
|
544
|
+
aops-cli doc version list --document-id <doc-id> --json
|
|
545
|
+
aops-cli doc version get --id <docver-id> --json
|
|
546
|
+
|
|
547
|
+
aops-cli doc section list --json
|
|
548
|
+
aops-cli doc section get --id <section-id> --json
|
|
549
|
+
|
|
550
|
+
aops-cli doc page list --json
|
|
551
|
+
aops-cli doc page get --id <page-id> --json
|
|
552
|
+
|
|
553
|
+
aops-cli doc page-version list --page-id <page-id> --json
|
|
554
|
+
aops-cli doc page-version get --id <pagever-id> --json
|
|
555
|
+
|
|
556
|
+
aops-cli doc outline get --document-version-id <docver-id> --json
|
|
557
|
+
```
|
|
558
|
+
|
|
559
|
+
### 5.13 Authoring with `--input @file.json`
|
|
560
|
+
|
|
561
|
+
#### 5.13.1 Overview
|
|
562
|
+
|
|
563
|
+
Section, page, version, and link commands accept shared JSON input. An explicit
|
|
564
|
+
CLI flag overrides the file value for the same field.
|
|
565
|
+
|
|
566
|
+
```bash
|
|
567
|
+
aops-cli doc section create \
|
|
568
|
+
--input @./section.json \
|
|
569
|
+
--title "Overview" \
|
|
570
|
+
--apply \
|
|
571
|
+
--json
|
|
572
|
+
```
|
|
573
|
+
|
|
574
|
+
### 5.14 Safely delete a disposable document
|
|
575
|
+
|
|
576
|
+
#### 5.14.1 Overview
|
|
577
|
+
|
|
578
|
+
Use the top-level safe-delete sugar only after reading back the exact document
|
|
579
|
+
id and its current title. The CLI forwards `--confirm-name` to
|
|
580
|
+
`document.delete.safe`; the domain rejects a title mismatch and protects the
|
|
581
|
+
document graph from an unsafe partial delete.
|
|
582
|
+
|
|
583
|
+
```bash
|
|
584
|
+
# Preflight does not delete anything.
|
|
585
|
+
aops-cli doc delete \
|
|
586
|
+
--id <doc-id> \
|
|
587
|
+
--confirm-name "Exact current document title" \
|
|
588
|
+
--preview \
|
|
589
|
+
--json
|
|
590
|
+
|
|
591
|
+
# Destructive execution requires both guards.
|
|
592
|
+
aops-cli doc delete \
|
|
593
|
+
--id <doc-id> \
|
|
594
|
+
--confirm-name "Exact current document title" \
|
|
595
|
+
--apply \
|
|
596
|
+
--confirm \
|
|
597
|
+
--json
|
|
598
|
+
```
|
|
599
|
+
|
|
600
|
+
For a disposable smoke test, first prove that a deliberately mismatched title
|
|
601
|
+
is rejected and that the document still exists. After the exact-title delete,
|
|
602
|
+
verify a definitive hosted not-found with `doc get --id <doc-id>`; do not treat
|
|
603
|
+
a zero exit code or absence from one list page as sufficient evidence.
|
|
604
|
+
|
|
605
|
+
The hosted operation classifies an exact-title mismatch as a `confirmName`
|
|
606
|
+
validation error (HTTP 400). It must never be reported as a server failure, and
|
|
607
|
+
the document must remain readable after the rejected request.
|
|
608
|
+
|
|
609
|
+
Canonical deletion does not remove bytes that were already written to a local
|
|
610
|
+
`.aops/docman` mirror or another `--out-dir`. Those files are stale read-only
|
|
611
|
+
cache data until explicitly reconciled. A targeted mirror pull for the deleted
|
|
612
|
+
slug fails because no hosted document matches, and it intentionally does not
|
|
613
|
+
erase the old file. Remove or replace only the exact known local mirror path as
|
|
614
|
+
a separate filesystem action after confirming the hosted not-found.
|
|
615
|
+
|
|
616
|
+
## 6 Mirror policy
|
|
617
|
+
|
|
618
|
+
### 6.1 Overview
|
|
619
|
+
|
|
620
|
+
Do not confuse Docman's three mirror and import concepts:
|
|
621
|
+
|
|
622
|
+
1. `doc mirror pull`: server truth -> `.aops/docman/**` read-only mirror.
|
|
623
|
+
2. `doc mirror push`: root `*.md` import utility; not a general update or
|
|
624
|
+
version-authoring path.
|
|
625
|
+
3. `doc import --from-markdown`: the dedicated authoring/migration surface that
|
|
626
|
+
creates an H2/H3 section and H4+ page graph from one Markdown file.
|
|
627
|
+
|
|
628
|
+
Text-file documents use a different contract:
|
|
629
|
+
|
|
630
|
+
1. The final domain operation id is `document.source-file.save`; the AOPS sugar
|
|
631
|
+
surface exposes it as `doc source-file save`. The former draft name
|
|
632
|
+
`document-version.source-file.put` is not used.
|
|
633
|
+
2. Save writes the exact UTF-8 source as an immutable page-version snapshot.
|
|
634
|
+
`--expected-version-id` and `--expected-content-hash` are stale-writer
|
|
635
|
+
guards; `--publish-now` completes the current/published lifecycle in the
|
|
636
|
+
same guarded flow.
|
|
637
|
+
3. A `contentMode=text-file` document contains exactly one root page. Sections,
|
|
638
|
+
a nested graph, or a second page cannot be created.
|
|
639
|
+
4. `fileExtension` must be lowercase and path-safe. `.cs`, `CS`, path
|
|
640
|
+
separators, `..`, whitespace/NUL, or an unknown source format are not
|
|
641
|
+
corrected automatically.
|
|
642
|
+
5. For a text file, `doc mirror pull` writes the raw `<slug>.<ext>` file and an
|
|
643
|
+
adjacent `<slug>.<ext>.docman.json` v3 sidecar. It injects no frontmatter or
|
|
644
|
+
comments into the raw file.
|
|
645
|
+
6. `doc mirror push` writes a new snapshot only when the v3 sidecar identity,
|
|
646
|
+
scope/project/version/hash, extension, and exact UTF-8/NUL guards pass.
|
|
647
|
+
|
|
648
|
+
Mirror v2 and v3 coexist:
|
|
649
|
+
|
|
650
|
+
1. Legacy/structured Markdown mirrors retain v2 `.md` behavior.
|
|
651
|
+
2. Text-file mirrors use v3 raw-file-plus-sidecar behavior.
|
|
652
|
+
3. When a legacy structured record has no profile, `md` is accepted for v2
|
|
653
|
+
compatibility. However, if its persisted structured `fileExtension` is
|
|
654
|
+
explicitly not `md`, it is rejected fail-closed. The structured mirror path
|
|
655
|
+
migration contract is not defined yet; this guard prevents silently
|
|
656
|
+
discarding the persisted extension and writing to the wrong file path.
|
|
657
|
+
|
|
658
|
+
For canonical server-truth documents, use the
|
|
659
|
+
`doc update/version/section/page` flow when the operator asks to create a new
|
|
660
|
+
Docman version or establish a section/page structure. Use mirror push only
|
|
661
|
+
when Markdown files should be imported as-is and their section/page graph can
|
|
662
|
+
be derived from the simple import format.
|
|
663
|
+
|
|
664
|
+
Mirror pull:
|
|
665
|
+
|
|
666
|
+
```bash
|
|
667
|
+
aops-cli doc mirror pull \
|
|
668
|
+
--group-uid eops-ui \
|
|
669
|
+
--out-dir .aops/docman \
|
|
670
|
+
--target markdown \
|
|
671
|
+
--project-name eops \
|
|
672
|
+
--apply \
|
|
673
|
+
--json
|
|
674
|
+
```
|
|
675
|
+
|
|
676
|
+
Checks after mirror pull:
|
|
677
|
+
|
|
678
|
+
1. The `.aops/docman/index.md` read-only index must exist.
|
|
679
|
+
2. `documentVersionId` and `documentVersion` in document frontmatter must
|
|
680
|
+
identify the expected version.
|
|
681
|
+
3. An agent may read the mirror for exact wording. For retrieval questions,
|
|
682
|
+
use the server-backed or `--local` `doc search|answer` surface.
|
|
683
|
+
|
|
684
|
+
## 7 Retrieval and publishing cookbook
|
|
685
|
+
|
|
686
|
+
### 7.1 Overview
|
|
687
|
+
|
|
688
|
+
Canonical read policy:
|
|
689
|
+
|
|
690
|
+
1. Use `doc answer` for broad questions.
|
|
691
|
+
2. Use `doc search` for hit discovery.
|
|
692
|
+
3. Use `doc scope search` to discover hits across multiple documents in a
|
|
693
|
+
project/scope.
|
|
694
|
+
4. Use `doc source` for exact composed source.
|
|
695
|
+
5. Use `doc publish` for final text output.
|
|
696
|
+
|
|
697
|
+
### 7.2 Keep retrieval builds explicit
|
|
698
|
+
|
|
699
|
+
#### 7.2.1 Overview
|
|
700
|
+
|
|
701
|
+
`search`, `scope search`, and `answer` are local-first by default: when the
|
|
702
|
+
repository mirror returns a hit, the CLI does not call the hosted server and
|
|
703
|
+
does not run `--ensure`. Use `--local` for an explicitly local/cache read and
|
|
704
|
+
`--remote` for the canonical hosted retrieval and build gate. On the hosted
|
|
705
|
+
path, the default `--ensure summary` refreshes index and summary rows before
|
|
706
|
+
reading. Use `--ensure none` to read without changing persisted rows, or
|
|
707
|
+
`--ensure index` to ensure only the index. Select an alternative mirror root
|
|
708
|
+
with `--mirror-dir <path>`.
|
|
709
|
+
|
|
710
|
+
Explicit build:
|
|
711
|
+
|
|
712
|
+
```bash
|
|
713
|
+
aops-cli doc index build --document-version-id <docver-id> --json
|
|
714
|
+
aops-cli doc summary build --document-version-id <docver-id> --json
|
|
715
|
+
```
|
|
716
|
+
|
|
717
|
+
Sugar sequence:
|
|
718
|
+
|
|
719
|
+
```bash
|
|
720
|
+
aops-cli doc answer \
|
|
721
|
+
--document-version-id <docver-id> \
|
|
722
|
+
--q "Enable pin behavior?" \
|
|
723
|
+
--ensure summary \
|
|
724
|
+
--json
|
|
725
|
+
```
|
|
726
|
+
|
|
727
|
+
`--ensure summary` is not hidden magic. The CLI first builds the summary, then
|
|
728
|
+
calls `answer-pack`. Production document publication must still pass the
|
|
729
|
+
explicit `index build` + `summary build` + retrieval-readback gate.
|
|
730
|
+
|
|
731
|
+
### 7.3 Search
|
|
732
|
+
|
|
733
|
+
#### 7.3.1 Overview
|
|
734
|
+
|
|
735
|
+
```bash
|
|
736
|
+
aops-cli doc search \
|
|
737
|
+
--document-version-id <docver-id> \
|
|
738
|
+
--q "startup current" \
|
|
739
|
+
--retrieval-strategy hybrid \
|
|
740
|
+
--remote \
|
|
741
|
+
--ensure summary \
|
|
742
|
+
--json
|
|
743
|
+
```
|
|
744
|
+
|
|
745
|
+
### 7.4 Scope-wide smart search
|
|
746
|
+
|
|
747
|
+
#### 7.4.1 Overview
|
|
748
|
+
|
|
749
|
+
```bash
|
|
750
|
+
aops-cli doc scope search \
|
|
751
|
+
--project-id <project-id> \
|
|
752
|
+
--q "startup current" \
|
|
753
|
+
--retrieval-strategy hybrid \
|
|
754
|
+
--json
|
|
755
|
+
```
|
|
756
|
+
|
|
757
|
+
Note:
|
|
758
|
+
|
|
759
|
+
1. This surface operates on the latest/current version of each document.
|
|
760
|
+
2. As v1 behavior, it automatically builds a missing index.
|
|
761
|
+
3. Hits include the document, section/page breadcrumb, page range, and excerpt.
|
|
762
|
+
|
|
763
|
+
### 7.5 Citation-first answer
|
|
764
|
+
|
|
765
|
+
#### 7.5.1 Overview
|
|
766
|
+
|
|
767
|
+
```bash
|
|
768
|
+
aops-cli doc answer \
|
|
769
|
+
--document-version-id <docver-id> \
|
|
770
|
+
--q "What does the startup sequence require?" \
|
|
771
|
+
--limit 3 \
|
|
772
|
+
--retrieval-strategy hybrid \
|
|
773
|
+
--remote \
|
|
774
|
+
--ensure summary \
|
|
775
|
+
--json
|
|
776
|
+
```
|
|
777
|
+
|
|
778
|
+
### 7.6 Exact composed source
|
|
779
|
+
|
|
780
|
+
#### 7.6.1 Overview
|
|
781
|
+
|
|
782
|
+
```bash
|
|
783
|
+
aops-cli doc source \
|
|
784
|
+
--document-version-id <docver-id> \
|
|
785
|
+
--section-id <section-id> \
|
|
786
|
+
--json
|
|
787
|
+
```
|
|
788
|
+
|
|
789
|
+
### 7.7 Materialize
|
|
790
|
+
|
|
791
|
+
#### 7.7.1 Overview
|
|
792
|
+
|
|
793
|
+
```bash
|
|
794
|
+
aops-cli doc publish \
|
|
795
|
+
--document-version-id <docver-id> \
|
|
796
|
+
--target markdown \
|
|
797
|
+
--json
|
|
798
|
+
|
|
799
|
+
aops-cli doc publish \
|
|
800
|
+
--document-version-id <docver-id> \
|
|
801
|
+
--target html \
|
|
802
|
+
--out ./tmp/doc.html
|
|
803
|
+
|
|
804
|
+
aops-cli doc publish \
|
|
805
|
+
--document-version-id <text-docver-id> \
|
|
806
|
+
--target source \
|
|
807
|
+
--out ./tmp/device-control.cs
|
|
808
|
+
```
|
|
809
|
+
|
|
810
|
+
Supported targets:
|
|
811
|
+
|
|
812
|
+
1. `markdown`
|
|
813
|
+
2. `html`
|
|
814
|
+
3. `source` (only for `contentMode=text-file`; exact saved UTF-8 source)
|
|
815
|
+
|
|
816
|
+
Note:
|
|
817
|
+
|
|
818
|
+
1. When `--out <path>` is provided, materialized content is written directly
|
|
819
|
+
to the file.
|
|
820
|
+
2. When used with `--json`, the response envelope also includes
|
|
821
|
+
`artifacts.outputPath`.
|
|
822
|
+
3. A `source` response carries `contentMode`, `sourceFormat`, `fileExtension`,
|
|
823
|
+
`suggestedFileName`, `mediaType`, and exact-source `contentHash` metadata;
|
|
824
|
+
the extension is not inferred from content.
|
|
825
|
+
4. Cockpit does not use the Markdown renderer for text files. It shows escaped
|
|
826
|
+
monospace source with wrap/copy/download controls and does not request an
|
|
827
|
+
outline.
|
|
828
|
+
|
|
829
|
+
## 8 Relationship with Memory and PM
|
|
830
|
+
|
|
831
|
+
### 8.1 Overview
|
|
832
|
+
|
|
833
|
+
Docman does not replace memory or planning.
|
|
834
|
+
|
|
835
|
+
Canonical reading order:
|
|
836
|
+
|
|
837
|
+
1. `agentspace` sticky guidance / project summary / resume memory
|
|
838
|
+
2. `docman`, when needed
|
|
839
|
+
3. `projectman`, when planning truth is needed
|
|
840
|
+
|
|
841
|
+
In short:
|
|
842
|
+
|
|
843
|
+
1. Memory tells the agent what to read.
|
|
844
|
+
2. Docman provides canonical content.
|
|
845
|
+
3. Projectman provides execution state.
|
|
846
|
+
|
|
847
|
+
## 9 Choosing a surface
|
|
848
|
+
|
|
849
|
+
### 9.1 For document-only work
|
|
850
|
+
|
|
851
|
+
#### 9.1.1 Overview
|
|
852
|
+
|
|
853
|
+
Use `aops-cli doc ...`.
|
|
854
|
+
|
|
855
|
+
### 9.2 When an agent is trying to understand a topic
|
|
856
|
+
|
|
857
|
+
#### 9.2.1 Overview
|
|
858
|
+
|
|
859
|
+
1. Start with `memory resume`.
|
|
860
|
+
2. Then run `summary get`.
|
|
861
|
+
3. When relevant, use `doc answer` or `doc search`.
|
|
862
|
+
4. Use `doc scope search` first when the agent needs to locate information
|
|
863
|
+
across multiple project documents.
|
|
864
|
+
|
|
865
|
+
### 9.3 When exact wording is required
|
|
866
|
+
|
|
867
|
+
#### 9.3.1 Overview
|
|
868
|
+
|
|
869
|
+
`doc source`
|
|
870
|
+
|
|
871
|
+
### 9.4 When a final render is required
|
|
872
|
+
|
|
873
|
+
#### 9.4.1 Overview
|
|
874
|
+
|
|
875
|
+
`doc publish`
|
|
876
|
+
|
|
877
|
+
To export to a file:
|
|
878
|
+
|
|
879
|
+
`doc publish --out <path>`
|
|
880
|
+
|
|
881
|
+
## 10 Notes
|
|
882
|
+
|
|
883
|
+
### 10.1 Overview
|
|
884
|
+
|
|
885
|
+
1. Docman retrieval is saved-version-only; unsaved editor state is not
|
|
886
|
+
canonical source.
|
|
887
|
+
2. `source` and `publish` use flat payloads; there is no nested `input`
|
|
888
|
+
envelope.
|
|
889
|
+
3. `docman` is not specific to AOPS. It also operates independently for
|
|
890
|
+
datasheets, runbooks, manuals, architecture documents, and technical
|
|
891
|
+
references.
|
|
892
|
+
|
|
893
|
+
## 11 Appendices
|
|
894
|
+
|
|
895
|
+
### 11.1 Overview
|
|
896
|
+
|
|
897
|
+
Do not edit the tables in this section by hand. Regenerate them from the AOPS
|
|
898
|
+
CLI Commander registrations with `aops docs user-guide --guide docman`.
|
|
899
|
+
|
|
900
|
+
<!-- aops-generated:docman-command-catalog:start -->
|
|
901
|
+
|
|
902
|
+
### 11.2 Generated Docman command catalog
|
|
903
|
+
|
|
904
|
+
#### 11.2.1 Overview
|
|
905
|
+
|
|
906
|
+
> This appendix is generated from the public `aops doc` Commander registrations. Do not edit it by hand; regenerate it with `aops docs user-guide --guide docman`.
|
|
907
|
+
|
|
908
|
+
| Command | Purpose |
|
|
909
|
+
| --- | --- |
|
|
910
|
+
| `aops doc` | Docman authoring, retrieval, and publish sugar over the hosted AOPS plane |
|
|
911
|
+
| `aops doc answer` | Read a citation-first deterministic answer pack for a saved document version |
|
|
912
|
+
| `aops doc create` | Create a Docman document through the canonical flow surface |
|
|
913
|
+
| `aops doc delete` | Safely delete one Docman document graph after exact title confirmation |
|
|
914
|
+
| `aops doc get` | Get a Docman document by id through the hosted gateway |
|
|
915
|
+
| `aops doc group` | Docman document-group commands |
|
|
916
|
+
| `aops doc group create` | Create a document group |
|
|
917
|
+
| `aops doc group delete` | Delete a document group |
|
|
918
|
+
| `aops doc group get` | Get a document group by id |
|
|
919
|
+
| `aops doc group list` | List document groups |
|
|
920
|
+
| `aops doc group update` | Update a document group |
|
|
921
|
+
| `aops doc import` | Import structured Docman content from source files |
|
|
922
|
+
| `aops doc index` | Docman retrieval index commands |
|
|
923
|
+
| `aops doc index build` | Build or refresh the persisted retrieval index for a saved document version |
|
|
924
|
+
| `aops doc link` | Docman structure linking commands |
|
|
925
|
+
| `aops doc link page` | Link or unlink pages in a section |
|
|
926
|
+
| `aops doc link section` | Link or unlink sections in a document outline |
|
|
927
|
+
| `aops doc link section delete` | Alias for doc section unlink |
|
|
928
|
+
| `aops doc list` | List Docman documents through the hosted gateway |
|
|
929
|
+
| `aops doc mirror` | Docman v2 structured and v3 source-file mirror helpers |
|
|
930
|
+
| `aops doc mirror pull` | Materialize structured v2 .md mirrors and exact v3 source files with adjacent sidecars |
|
|
931
|
+
| `aops doc mirror push` | Import root markdown files or guarded-push one v3 source file with its adjacent sidecar |
|
|
932
|
+
| `aops doc order` | Docman outline ordering commands |
|
|
933
|
+
| `aops doc order pages` | Update section-page-link ordering through the canonical flow surface |
|
|
934
|
+
| `aops doc order sections` | Update document-section-link ordering through the canonical flow surface |
|
|
935
|
+
| `aops doc outline` | Docman normalized outline inspection |
|
|
936
|
+
| `aops doc outline get` | Read a section-centric normalized outline for a saved document version |
|
|
937
|
+
| `aops doc page` | Docman page and page-version commands |
|
|
938
|
+
| `aops doc page copy` | Copy a page into a section through the canonical flow surface |
|
|
939
|
+
| `aops doc page create` | Create a page with its first draft and optionally link it into a document tree |
|
|
940
|
+
| `aops doc page draft-save` | Create or update a page-version draft through the canonical flow surface |
|
|
941
|
+
| `aops doc page get` | Get a page by id |
|
|
942
|
+
| `aops doc page list` | List pages |
|
|
943
|
+
| `aops doc page membership-unlink` | Delete a reusable section-page-link without deleting the page |
|
|
944
|
+
| `aops doc page move` | Move a section-page-link to another section |
|
|
945
|
+
| `aops doc page unlink` | Unlink a page node created in the document outline without deleting the page |
|
|
946
|
+
| `aops doc page update` | Update Docman page metadata through the canonical flow surface |
|
|
947
|
+
| `aops doc page-version` | Docman page-version commands |
|
|
948
|
+
| `aops doc page-version get` | Get a page version by id |
|
|
949
|
+
| `aops doc page-version list` | List page versions |
|
|
950
|
+
| `aops doc page-version update` | Update page-version metadata; content changes must use doc page draft-save |
|
|
951
|
+
| `aops doc publish` | Materialize saved document content to markdown, html, or exact source |
|
|
952
|
+
| `aops doc scope` | Docman scope-owned retrieval commands |
|
|
953
|
+
| `aops doc scope answer` | Read a citation-first answer pack across latest document versions in one scope |
|
|
954
|
+
| `aops doc scope search` | Search persisted Docman retrieval rows across latest document versions in one scope |
|
|
955
|
+
| `aops doc search` | Search persisted Docman retrieval rows for a saved document version |
|
|
956
|
+
| `aops doc section` | Docman section commands |
|
|
957
|
+
| `aops doc section copy` | Copy a section into a document version through the canonical flow surface |
|
|
958
|
+
| `aops doc section create` | Create a section and optionally link it into a document outline |
|
|
959
|
+
| `aops doc section get` | Get a section by id |
|
|
960
|
+
| `aops doc section list` | List sections |
|
|
961
|
+
| `aops doc section unlink` | Unlink a section from a document outline without deleting the section |
|
|
962
|
+
| `aops doc section update` | Update a Docman section through the canonical flow surface |
|
|
963
|
+
| `aops doc set-current-version` | Flip a document’s canonical current version atomically (peer-clear + optional publish + publishedAt). Dispatches docman.document-version.set-current. |
|
|
964
|
+
| `aops doc source` | Fetch exact composed source for a saved document fragment |
|
|
965
|
+
| `aops doc source-file` | Immutable Docman text-file snapshot commands |
|
|
966
|
+
| `aops doc source-file save` | Save an exact UTF-8 source file as a new immutable text-file document version |
|
|
967
|
+
| `aops doc summary` | Docman persisted summary commands |
|
|
968
|
+
| `aops doc summary build` | Build or refresh persisted summaries for a saved document version; index rows are ensured first |
|
|
969
|
+
| `aops doc update` | Update a Docman document through the canonical flow surface |
|
|
970
|
+
| `aops doc version` | Docman document-version commands |
|
|
971
|
+
| `aops doc version create` | Create a document version through the canonical flow surface |
|
|
972
|
+
| `aops doc version get` | Get a document version by id |
|
|
973
|
+
| `aops doc version list` | List document versions |
|
|
974
|
+
| `aops doc version update` | Update document-version header metadata (status / title / summary / release-notes / label). To switch the canonical current version, use `aops-cli doc set-current-version` instead. |
|
|
975
|
+
|
|
976
|
+
<!-- aops-generated:docman-command-catalog:end -->
|
|
977
|
+
|
|
978
|
+
<!-- aops-generated:docman-discovery:start -->
|
|
979
|
+
|
|
980
|
+
### 11.3 Generated Docman discovery and retrieval guide
|
|
981
|
+
|
|
982
|
+
#### 11.3.1 Overview
|
|
983
|
+
|
|
984
|
+
> Docman operations and schemas are discovered from the running server. This appendix keeps the retrieval gates current without copying a fixed hosted-tool inventory into prose.
|
|
985
|
+
|
|
986
|
+
| Command | Purpose |
|
|
987
|
+
| --- | --- |
|
|
988
|
+
| `aops doc outline get` | Read a section-centric normalized outline for a saved document version |
|
|
989
|
+
| `aops doc index build` | Build or refresh the persisted retrieval index for a saved document version |
|
|
990
|
+
| `aops doc summary build` | Build or refresh persisted summaries for a saved document version; index rows are ensured first |
|
|
991
|
+
| `aops doc search` | Search persisted Docman retrieval rows for a saved document version |
|
|
992
|
+
| `aops doc scope search` | Search persisted Docman retrieval rows across latest document versions in one scope |
|
|
993
|
+
| `aops doc answer` | Read a citation-first deterministic answer pack for a saved document version |
|
|
994
|
+
| `aops doc source` | Fetch exact composed source for a saved document fragment |
|
|
995
|
+
| `aops doc mirror pull` | Materialize structured v2 .md mirrors and exact v3 source files with adjacent sidecars |
|
|
996
|
+
| `aops agent tools` | List federated tools from the canonical operator plane (/api/agent/tools) |
|
|
997
|
+
| `aops agent schema` | Print the live JSON Schema for one tool's input contract — use this before authoring --input payloads |
|
|
998
|
+
|
|
999
|
+
Use the smallest useful read:
|
|
1000
|
+
|
|
1001
|
+
```bash
|
|
1002
|
+
aops doc search --local --q "<keywords>" --ensure summary --json
|
|
1003
|
+
aops doc scope search --project-slug <slug> --q "<keywords>" --json
|
|
1004
|
+
aops doc answer --document-version-id <id> --q "<question>" --ensure summary --json
|
|
1005
|
+
aops agent tools --domain docman --summary --json
|
|
1006
|
+
aops agent schema --tool <docman-tool-id> --summary --json
|
|
1007
|
+
```
|
|
1008
|
+
|
|
1009
|
+
<!-- aops-generated:docman-discovery:end -->
|