agent-wiki-workspace 0.1.0__tar.gz
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.
- agent_wiki_workspace-0.1.0/.gitignore +14 -0
- agent_wiki_workspace-0.1.0/LICENSE +201 -0
- agent_wiki_workspace-0.1.0/NOTICE +4 -0
- agent_wiki_workspace-0.1.0/PKG-INFO +158 -0
- agent_wiki_workspace-0.1.0/README.md +135 -0
- agent_wiki_workspace-0.1.0/docs/release.md +49 -0
- agent_wiki_workspace-0.1.0/docs/verification.md +40 -0
- agent_wiki_workspace-0.1.0/pyproject.toml +97 -0
- agent_wiki_workspace-0.1.0/scripts/check_critical_coverage.py +207 -0
- agent_wiki_workspace-0.1.0/scripts/run_live_e2e.py +26 -0
- agent_wiki_workspace-0.1.0/src/agent_wiki_workspace/__init__.py +65 -0
- agent_wiki_workspace-0.1.0/src/agent_wiki_workspace/__main__.py +3 -0
- agent_wiki_workspace-0.1.0/src/agent_wiki_workspace/_io.py +120 -0
- agent_wiki_workspace-0.1.0/src/agent_wiki_workspace/cli.py +586 -0
- agent_wiki_workspace-0.1.0/src/agent_wiki_workspace/errors.py +21 -0
- agent_wiki_workspace-0.1.0/src/agent_wiki_workspace/knowledge_base.py +1205 -0
- agent_wiki_workspace-0.1.0/src/agent_wiki_workspace/models.py +428 -0
- agent_wiki_workspace-0.1.0/src/agent_wiki_workspace/opencode.py +74 -0
- agent_wiki_workspace-0.1.0/src/agent_wiki_workspace/py.typed +1 -0
- agent_wiki_workspace-0.1.0/src/agent_wiki_workspace/registry.py +894 -0
- agent_wiki_workspace-0.1.0/src/agent_wiki_workspace/resources/schemas/AgentRegistration.schema.json +47 -0
- agent_wiki_workspace-0.1.0/src/agent_wiki_workspace/resources/schemas/ChangeOperation.schema.json +49 -0
- agent_wiki_workspace-0.1.0/src/agent_wiki_workspace/resources/schemas/ChangeSet.schema.json +271 -0
- agent_wiki_workspace-0.1.0/src/agent_wiki_workspace/resources/schemas/CurationJob.schema.json +102 -0
- agent_wiki_workspace-0.1.0/src/agent_wiki_workspace/resources/schemas/Diagnostic.schema.json +36 -0
- agent_wiki_workspace-0.1.0/src/agent_wiki_workspace/resources/schemas/EvidenceReference.schema.json +90 -0
- agent_wiki_workspace-0.1.0/src/agent_wiki_workspace/resources/schemas/FederatedQueryRequest.schema.json +39 -0
- agent_wiki_workspace-0.1.0/src/agent_wiki_workspace/resources/schemas/FederatedQueryResult.schema.json +319 -0
- agent_wiki_workspace-0.1.0/src/agent_wiki_workspace/resources/schemas/KnowledgeBaseManifest.schema.json +142 -0
- agent_wiki_workspace-0.1.0/src/agent_wiki_workspace/resources/schemas/KnowledgeBaseProfile.schema.json +66 -0
- agent_wiki_workspace-0.1.0/src/agent_wiki_workspace/resources/schemas/NoteReadResult.schema.json +31 -0
- agent_wiki_workspace-0.1.0/src/agent_wiki_workspace/resources/schemas/OpenCodeInstallResult.schema.json +38 -0
- agent_wiki_workspace-0.1.0/src/agent_wiki_workspace/resources/schemas/QueryRequest.schema.json +52 -0
- agent_wiki_workspace-0.1.0/src/agent_wiki_workspace/resources/schemas/QueryResult.schema.json +217 -0
- agent_wiki_workspace-0.1.0/src/agent_wiki_workspace/resources/schemas/README.md +5 -0
- agent_wiki_workspace-0.1.0/src/agent_wiki_workspace/resources/schemas/RuntimeBinding.schema.json +36 -0
- agent_wiki_workspace-0.1.0/src/agent_wiki_workspace/resources/schemas/SourceRecord.schema.json +80 -0
- agent_wiki_workspace-0.1.0/src/agent_wiki_workspace/resources/schemas/SupportedClaim.schema.json +118 -0
- agent_wiki_workspace-0.1.0/src/agent_wiki_workspace/resources/schemas/VerificationResult.schema.json +86 -0
- agent_wiki_workspace-0.1.0/src/agent_wiki_workspace/resources/schemas/VisualJob.schema.json +151 -0
- agent_wiki_workspace-0.1.0/src/agent_wiki_workspace/resources/schemas/VisualResult.schema.json +309 -0
- agent_wiki_workspace-0.1.0/src/agent_wiki_workspace/resources/schemas/WikiCreateResult.schema.json +43 -0
- agent_wiki_workspace-0.1.0/src/agent_wiki_workspace/resources/schemas/WikiSearchHit.schema.json +36 -0
- agent_wiki_workspace-0.1.0/src/agent_wiki_workspace/resources/skill/agent-wiki-workspace/SKILL.md +54 -0
- agent_wiki_workspace-0.1.0/tests/conftest.py +179 -0
- agent_wiki_workspace-0.1.0/tests/live/test_openrouter_multiwiki.py +815 -0
- agent_wiki_workspace-0.1.0/tests/test_acceptance_hardening.py +129 -0
- agent_wiki_workspace-0.1.0/tests/test_cli.py +228 -0
- agent_wiki_workspace-0.1.0/tests/test_cli_workflow.py +399 -0
- agent_wiki_workspace-0.1.0/tests/test_contract_lifecycle.py +552 -0
- agent_wiki_workspace-0.1.0/tests/test_critical_coverage_gate.py +79 -0
- agent_wiki_workspace-0.1.0/tests/test_critical_safety_coverage.py +653 -0
- agent_wiki_workspace-0.1.0/tests/test_edge_cases.py +398 -0
- agent_wiki_workspace-0.1.0/tests/test_knowledge_base.py +267 -0
- agent_wiki_workspace-0.1.0/tests/test_models.py +169 -0
- agent_wiki_workspace-0.1.0/tests/test_opencode_hardening.py +324 -0
- agent_wiki_workspace-0.1.0/tests/test_path_security.py +234 -0
- agent_wiki_workspace-0.1.0/tests/test_registry_opencode.py +127 -0
- agent_wiki_workspace-0.1.0/tests/test_security_and_opencode.py +74 -0
- agent_wiki_workspace-0.1.0/tests/test_skill.py +41 -0
- agent_wiki_workspace-0.1.0/tests/test_source_exploration.py +130 -0
- agent_wiki_workspace-0.1.0/uv.lock +1246 -0
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 Dark Light
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: agent-wiki-workspace
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Contract-driven Markdown knowledge bases for PDF-aware agents
|
|
5
|
+
Author-email: Dark Light <darklight@noreply.com>
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
License-File: NOTICE
|
|
9
|
+
Keywords: agents,knowledge-base,markdown,obsidian,pdf
|
|
10
|
+
Classifier: Development Status :: 3 - Alpha
|
|
11
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
17
|
+
Requires-Python: <3.15,>=3.11
|
|
18
|
+
Requires-Dist: agent-pdf-workspace<0.2,>=0.1.1
|
|
19
|
+
Requires-Dist: pydantic<3,>=2.11
|
|
20
|
+
Requires-Dist: pyyaml<7,>=6
|
|
21
|
+
Requires-Dist: typer<1,>=0.16
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
|
|
24
|
+
# agent-wiki-workspace
|
|
25
|
+
|
|
26
|
+
`agent-wiki-workspace` builds persistent, searchable Markdown knowledge bases from local PDFs.
|
|
27
|
+
It uses [`agent-pdf-workspace`](https://pypi.org/project/agent-pdf-workspace/) for local extraction
|
|
28
|
+
and OCR, keeps the complete source workspace, and exposes strict JSON contracts to external agents.
|
|
29
|
+
The package itself contains no LLM, vision, embedding, or network client.
|
|
30
|
+
|
|
31
|
+
## What it creates
|
|
32
|
+
|
|
33
|
+
An existing Markdown or Obsidian vault can be adopted in place, or a new empty directory can be
|
|
34
|
+
initialized:
|
|
35
|
+
|
|
36
|
+
```text
|
|
37
|
+
wiki/
|
|
38
|
+
├── Sources/ Concepts/ Entities/ Syntheses/
|
|
39
|
+
├── raw/<source-id>/ # complete agent-pdf-workspace output
|
|
40
|
+
└── .agent-wiki/
|
|
41
|
+
├── manifest.json
|
|
42
|
+
├── profile.{json,md}
|
|
43
|
+
├── jobs/{curation,query,visual}/
|
|
44
|
+
├── changesets/
|
|
45
|
+
└── cache/search.sqlite
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Existing notes, `.obsidian/`, `AGENTS.md`, and symlinks are not rewritten or followed. Curated
|
|
49
|
+
claims retain PDF page and block or bounding-box evidence. Agent changes are staged first and are
|
|
50
|
+
applied only by an explicit host/user action.
|
|
51
|
+
|
|
52
|
+
## Install
|
|
53
|
+
|
|
54
|
+
Python 3.11 through 3.14 is supported. A permanent tool environment is recommended because the
|
|
55
|
+
generated OpenCode tool records its exact Python virtual-environment launcher:
|
|
56
|
+
|
|
57
|
+
```console
|
|
58
|
+
uv tool install agent-wiki-workspace
|
|
59
|
+
wikiws --help
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
For repository development, use the pinned pyenv version and lockfile:
|
|
63
|
+
|
|
64
|
+
```console
|
|
65
|
+
pyenv install -s 3.11.14
|
|
66
|
+
uv sync --frozen --group dev
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Quick start
|
|
70
|
+
|
|
71
|
+
```console
|
|
72
|
+
# A new wiki must be new or empty.
|
|
73
|
+
wikiws init /absolute/path/to/wiki --mode create --json
|
|
74
|
+
|
|
75
|
+
# Existing Markdown/Obsidian content is adopted without modifying existing files.
|
|
76
|
+
wikiws init /absolute/path/to/vault --mode adopt --json
|
|
77
|
+
|
|
78
|
+
# Extraction and OCR are local. The original PDF stays under raw/<source-id>/.
|
|
79
|
+
wikiws source add /absolute/path/to/wiki report.pdf --ocr auto --language deu+eng --json
|
|
80
|
+
|
|
81
|
+
# Explore locally.
|
|
82
|
+
wikiws search /absolute/path/to/wiki "specific phrase" --json
|
|
83
|
+
wikiws read /absolute/path/to/wiki --note "Sources/report.md" --json
|
|
84
|
+
|
|
85
|
+
# Agent-authored changes remain pending until explicitly approved.
|
|
86
|
+
wikiws curate prepare /absolute/path/to/wiki --source-id src-... --json
|
|
87
|
+
wikiws curate submit /absolute/path/to/wiki --input changeset.json --json
|
|
88
|
+
wikiws changes apply /absolute/path/to/wiki --changeset-id chg-... --json
|
|
89
|
+
|
|
90
|
+
wikiws lint /absolute/path/to/wiki --json
|
|
91
|
+
wikiws verify /absolute/path/to/wiki --json
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Machine-readable mode writes JSON only to stdout and diagnostics to stderr. Exit codes are `0`
|
|
95
|
+
(success), `2` (input/contract error), `3` (incomplete state), `4` (resource limit), and `5`
|
|
96
|
+
(integrity/security failure).
|
|
97
|
+
|
|
98
|
+
## OpenCode integration
|
|
99
|
+
|
|
100
|
+
Register one router, one curator per wiki, a shared vision agent, the packaged skill, and native
|
|
101
|
+
tools with:
|
|
102
|
+
|
|
103
|
+
```console
|
|
104
|
+
wikiws opencode sync
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
The router and shared vision agent are installed as primary agents; per-Wiki curators are
|
|
108
|
+
registered as restricted subagents and communicate through persisted versioned contracts.
|
|
109
|
+
|
|
110
|
+
The command discovers the configuration through `OPENCODE_CONFIG_DIR` or `opencode debug paths`.
|
|
111
|
+
It never edits `opencode.json` and refuses collisions with files it does not own. Interactive sync
|
|
112
|
+
asks which vision-capable `provider/model` to use. The default is
|
|
113
|
+
`openrouter/google/gemma-4-31b-it`; automation can choose any valid OpenCode model identifier:
|
|
114
|
+
|
|
115
|
+
```console
|
|
116
|
+
wikiws opencode sync --vision-model openrouter/google/gemma-4-31b-it --json
|
|
117
|
+
wikiws doctor --json
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
The generated TypeScript tool starts exactly
|
|
121
|
+
`[absolute-venv-python, "-m", "agent_wiki_workspace", ...]` without a shell or `PATH` lookup.
|
|
122
|
+
Running sync again updates that binding after moving or reinstalling the environment.
|
|
123
|
+
|
|
124
|
+
Visual jobs remain pending if the selected agent/model cannot inspect images. Text curation and
|
|
125
|
+
search continue with `visual_coverage: pending`; no description is fabricated. A capable external
|
|
126
|
+
agent reads only a registered crop, then persists a matching `VisualResult`. Whether an image may
|
|
127
|
+
be sent to a remote model is the calling system's privacy decision.
|
|
128
|
+
|
|
129
|
+
## Python API
|
|
130
|
+
|
|
131
|
+
```python
|
|
132
|
+
from agent_wiki_workspace import KnowledgeBase, KnowledgeRegistry
|
|
133
|
+
|
|
134
|
+
kb = KnowledgeBase.init("/absolute/path/to/wiki", mode="create")
|
|
135
|
+
source = kb.add_pdf("report.pdf", ocr="auto", languages=("deu", "eng"))
|
|
136
|
+
job = kb.prepare_curation(source.source_id)
|
|
137
|
+
hits = kb.search("specific phrase")
|
|
138
|
+
|
|
139
|
+
registry = KnowledgeRegistry.open()
|
|
140
|
+
registry.register(kb)
|
|
141
|
+
registry.install_opencode(vision_model="openrouter/google/gemma-4-31b-it")
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
All public agent contracts are Pydantic models using schema `1.0`, reject unknown fields, and fail
|
|
145
|
+
closed on wrong wiki/job IDs, expired jobs, unsafe paths, stale updates, or unverifiable evidence.
|
|
146
|
+
A source changeset copies `job.job_id` and cites every claim with a `block_id` or page-bounded
|
|
147
|
+
`bbox` from the PDF layout sidecar. Block quotes are normalized and checked against block text.
|
|
148
|
+
|
|
149
|
+
## Trust boundary
|
|
150
|
+
|
|
151
|
+
PDF text, OCR, Markdown, metadata, links, attachments, QR codes, and images are untrusted content.
|
|
152
|
+
They are never executed or fetched. Package-generated agents deny web and shell tools and receive
|
|
153
|
+
only role-specific wiki tools. PDF passwords are accepted through Python parameters or stdin and
|
|
154
|
+
are never persisted.
|
|
155
|
+
|
|
156
|
+
See [the release procedure](docs/release.md) and [verification status](docs/verification.md) for
|
|
157
|
+
reproducible builds, critical coverage, neutral clean-environment evidence, and the explicitly
|
|
158
|
+
networked OpenRouter/OpenCode multi-wiki release gate.
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
# agent-wiki-workspace
|
|
2
|
+
|
|
3
|
+
`agent-wiki-workspace` builds persistent, searchable Markdown knowledge bases from local PDFs.
|
|
4
|
+
It uses [`agent-pdf-workspace`](https://pypi.org/project/agent-pdf-workspace/) for local extraction
|
|
5
|
+
and OCR, keeps the complete source workspace, and exposes strict JSON contracts to external agents.
|
|
6
|
+
The package itself contains no LLM, vision, embedding, or network client.
|
|
7
|
+
|
|
8
|
+
## What it creates
|
|
9
|
+
|
|
10
|
+
An existing Markdown or Obsidian vault can be adopted in place, or a new empty directory can be
|
|
11
|
+
initialized:
|
|
12
|
+
|
|
13
|
+
```text
|
|
14
|
+
wiki/
|
|
15
|
+
├── Sources/ Concepts/ Entities/ Syntheses/
|
|
16
|
+
├── raw/<source-id>/ # complete agent-pdf-workspace output
|
|
17
|
+
└── .agent-wiki/
|
|
18
|
+
├── manifest.json
|
|
19
|
+
├── profile.{json,md}
|
|
20
|
+
├── jobs/{curation,query,visual}/
|
|
21
|
+
├── changesets/
|
|
22
|
+
└── cache/search.sqlite
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Existing notes, `.obsidian/`, `AGENTS.md`, and symlinks are not rewritten or followed. Curated
|
|
26
|
+
claims retain PDF page and block or bounding-box evidence. Agent changes are staged first and are
|
|
27
|
+
applied only by an explicit host/user action.
|
|
28
|
+
|
|
29
|
+
## Install
|
|
30
|
+
|
|
31
|
+
Python 3.11 through 3.14 is supported. A permanent tool environment is recommended because the
|
|
32
|
+
generated OpenCode tool records its exact Python virtual-environment launcher:
|
|
33
|
+
|
|
34
|
+
```console
|
|
35
|
+
uv tool install agent-wiki-workspace
|
|
36
|
+
wikiws --help
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
For repository development, use the pinned pyenv version and lockfile:
|
|
40
|
+
|
|
41
|
+
```console
|
|
42
|
+
pyenv install -s 3.11.14
|
|
43
|
+
uv sync --frozen --group dev
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Quick start
|
|
47
|
+
|
|
48
|
+
```console
|
|
49
|
+
# A new wiki must be new or empty.
|
|
50
|
+
wikiws init /absolute/path/to/wiki --mode create --json
|
|
51
|
+
|
|
52
|
+
# Existing Markdown/Obsidian content is adopted without modifying existing files.
|
|
53
|
+
wikiws init /absolute/path/to/vault --mode adopt --json
|
|
54
|
+
|
|
55
|
+
# Extraction and OCR are local. The original PDF stays under raw/<source-id>/.
|
|
56
|
+
wikiws source add /absolute/path/to/wiki report.pdf --ocr auto --language deu+eng --json
|
|
57
|
+
|
|
58
|
+
# Explore locally.
|
|
59
|
+
wikiws search /absolute/path/to/wiki "specific phrase" --json
|
|
60
|
+
wikiws read /absolute/path/to/wiki --note "Sources/report.md" --json
|
|
61
|
+
|
|
62
|
+
# Agent-authored changes remain pending until explicitly approved.
|
|
63
|
+
wikiws curate prepare /absolute/path/to/wiki --source-id src-... --json
|
|
64
|
+
wikiws curate submit /absolute/path/to/wiki --input changeset.json --json
|
|
65
|
+
wikiws changes apply /absolute/path/to/wiki --changeset-id chg-... --json
|
|
66
|
+
|
|
67
|
+
wikiws lint /absolute/path/to/wiki --json
|
|
68
|
+
wikiws verify /absolute/path/to/wiki --json
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Machine-readable mode writes JSON only to stdout and diagnostics to stderr. Exit codes are `0`
|
|
72
|
+
(success), `2` (input/contract error), `3` (incomplete state), `4` (resource limit), and `5`
|
|
73
|
+
(integrity/security failure).
|
|
74
|
+
|
|
75
|
+
## OpenCode integration
|
|
76
|
+
|
|
77
|
+
Register one router, one curator per wiki, a shared vision agent, the packaged skill, and native
|
|
78
|
+
tools with:
|
|
79
|
+
|
|
80
|
+
```console
|
|
81
|
+
wikiws opencode sync
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
The router and shared vision agent are installed as primary agents; per-Wiki curators are
|
|
85
|
+
registered as restricted subagents and communicate through persisted versioned contracts.
|
|
86
|
+
|
|
87
|
+
The command discovers the configuration through `OPENCODE_CONFIG_DIR` or `opencode debug paths`.
|
|
88
|
+
It never edits `opencode.json` and refuses collisions with files it does not own. Interactive sync
|
|
89
|
+
asks which vision-capable `provider/model` to use. The default is
|
|
90
|
+
`openrouter/google/gemma-4-31b-it`; automation can choose any valid OpenCode model identifier:
|
|
91
|
+
|
|
92
|
+
```console
|
|
93
|
+
wikiws opencode sync --vision-model openrouter/google/gemma-4-31b-it --json
|
|
94
|
+
wikiws doctor --json
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
The generated TypeScript tool starts exactly
|
|
98
|
+
`[absolute-venv-python, "-m", "agent_wiki_workspace", ...]` without a shell or `PATH` lookup.
|
|
99
|
+
Running sync again updates that binding after moving or reinstalling the environment.
|
|
100
|
+
|
|
101
|
+
Visual jobs remain pending if the selected agent/model cannot inspect images. Text curation and
|
|
102
|
+
search continue with `visual_coverage: pending`; no description is fabricated. A capable external
|
|
103
|
+
agent reads only a registered crop, then persists a matching `VisualResult`. Whether an image may
|
|
104
|
+
be sent to a remote model is the calling system's privacy decision.
|
|
105
|
+
|
|
106
|
+
## Python API
|
|
107
|
+
|
|
108
|
+
```python
|
|
109
|
+
from agent_wiki_workspace import KnowledgeBase, KnowledgeRegistry
|
|
110
|
+
|
|
111
|
+
kb = KnowledgeBase.init("/absolute/path/to/wiki", mode="create")
|
|
112
|
+
source = kb.add_pdf("report.pdf", ocr="auto", languages=("deu", "eng"))
|
|
113
|
+
job = kb.prepare_curation(source.source_id)
|
|
114
|
+
hits = kb.search("specific phrase")
|
|
115
|
+
|
|
116
|
+
registry = KnowledgeRegistry.open()
|
|
117
|
+
registry.register(kb)
|
|
118
|
+
registry.install_opencode(vision_model="openrouter/google/gemma-4-31b-it")
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
All public agent contracts are Pydantic models using schema `1.0`, reject unknown fields, and fail
|
|
122
|
+
closed on wrong wiki/job IDs, expired jobs, unsafe paths, stale updates, or unverifiable evidence.
|
|
123
|
+
A source changeset copies `job.job_id` and cites every claim with a `block_id` or page-bounded
|
|
124
|
+
`bbox` from the PDF layout sidecar. Block quotes are normalized and checked against block text.
|
|
125
|
+
|
|
126
|
+
## Trust boundary
|
|
127
|
+
|
|
128
|
+
PDF text, OCR, Markdown, metadata, links, attachments, QR codes, and images are untrusted content.
|
|
129
|
+
They are never executed or fetched. Package-generated agents deny web and shell tools and receive
|
|
130
|
+
only role-specific wiki tools. PDF passwords are accepted through Python parameters or stdin and
|
|
131
|
+
are never persisted.
|
|
132
|
+
|
|
133
|
+
See [the release procedure](docs/release.md) and [verification status](docs/verification.md) for
|
|
134
|
+
reproducible builds, critical coverage, neutral clean-environment evidence, and the explicitly
|
|
135
|
+
networked OpenRouter/OpenCode multi-wiki release gate.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Release procedure
|
|
2
|
+
|
|
3
|
+
1. Confirm that `agent-wiki-workspace` is still available on PyPI.
|
|
4
|
+
2. Run `uv sync --frozen --group dev` with Python 3.11.14.
|
|
5
|
+
3. Run Ruff, Mypy, the complete test suite, and both coverage gates:
|
|
6
|
+
|
|
7
|
+
```console
|
|
8
|
+
uv run ruff check .
|
|
9
|
+
uv run ruff format --check .
|
|
10
|
+
uv run mypy src scripts/check_critical_coverage.py
|
|
11
|
+
uv run coverage run -m pytest -q
|
|
12
|
+
uv run coverage report -m --fail-under=90
|
|
13
|
+
uv run coverage json -o coverage.json --fail-under=0
|
|
14
|
+
uv run python scripts/check_critical_coverage.py coverage.json
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
The final command requires 100 percent line and branch coverage for the versioned
|
|
18
|
+
contracts and the security-/state-critical path, staging, apply, rollback, recovery, and
|
|
19
|
+
visual-status functions. Its AST-based scopes follow function names instead of fixed line
|
|
20
|
+
ranges.
|
|
21
|
+
4. Set `OPENROUTER_API_KEY` in the process environment and run
|
|
22
|
+
`uv run python scripts/run_live_e2e.py`. The release stops if credentials, OpenCode, the
|
|
23
|
+
requested Gemma model, any Wiki contract, OCR evidence, the extracted table, or visual
|
|
24
|
+
coverage are missing. The run exercises five router scenarios that must produce six persisted
|
|
25
|
+
QueryResult contracts: single-Wiki, multi-Wiki, `not_found`, table evidence, and an untrusted
|
|
26
|
+
prompt-injection fixture. It handles every required visual job in its fixture, including the
|
|
27
|
+
page audit, with a hard maximum of three visual jobs.
|
|
28
|
+
It compares the `usage` value from OpenRouter's official
|
|
29
|
+
[`GET /api/v1/key`](https://openrouter.ai/docs/api/api-reference/api-keys/get-current-key)
|
|
30
|
+
response before and after the run. `OPENROUTER_E2E_MAX_COST_USD` sets the allowed difference;
|
|
31
|
+
the default is USD 1.00. Only numeric usage fields are retained, never the key, label, or raw
|
|
32
|
+
response body.
|
|
33
|
+
5. Build with `uv build`, install the wheel in an empty virtualenv, and run the CLI smoke test.
|
|
34
|
+
6. Publish with `uv publish`. Supply credentials through the environment or trusted publishing;
|
|
35
|
+
never place tokens in configuration committed to this repository.
|
|
36
|
+
|
|
37
|
+
The supported permanent OpenCode installation is:
|
|
38
|
+
|
|
39
|
+
```text
|
|
40
|
+
uv tool install agent-wiki-workspace
|
|
41
|
+
wikiws opencode sync
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
`wikiws opencode sync` interactively asks for the vision model. Automation should pass
|
|
45
|
+
`--vision-model provider/model`; the stored value is reused on subsequent non-interactive syncs.
|
|
46
|
+
|
|
47
|
+
The latest local and neutral-container evidence is recorded in
|
|
48
|
+
[`verification.md`](verification.md). A skipped or failed live test is a release blocker, not a
|
|
49
|
+
successful release result.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Verification status for 0.1.0
|
|
2
|
+
|
|
3
|
+
Last updated: 2026-07-17.
|
|
4
|
+
|
|
5
|
+
## Local deterministic gates
|
|
6
|
+
|
|
7
|
+
- 211 tests passed; the explicitly networked OpenRouter test was skipped in the deterministic
|
|
8
|
+
suite and run separately as described below.
|
|
9
|
+
- Overall branch-enabled coverage: 96 percent.
|
|
10
|
+
- Critical gate: 697/697 executable lines and 210/210 branch arcs.
|
|
11
|
+
- Ruff lint and format checks passed.
|
|
12
|
+
- Strict Mypy passed for the package and critical-coverage checker.
|
|
13
|
+
- `uv lock --check`, schema byte comparison, and `git diff --check` passed.
|
|
14
|
+
- Wheel code imported directly from the built wheel; CLI version/help, all 22 schema exports,
|
|
15
|
+
Wiki initialization, OpenCode generation, lint, verify, and doctor passed.
|
|
16
|
+
|
|
17
|
+
## Neutral Linux clean environments
|
|
18
|
+
|
|
19
|
+
The built wheel was installed and exercised in fresh Docker environments on Linux arm64 with
|
|
20
|
+
Python 3.11, 3.12, 3.13, and 3.14, plus Linux x86_64 with Python 3.11. Every environment passed
|
|
21
|
+
import, version, Wiki initialization, lint, verify, and doctor. The generated runtime used the
|
|
22
|
+
exact `/venv/bin/python` executable and retained the selected vision model.
|
|
23
|
+
|
|
24
|
+
The sdist also installed in a fresh Python 3.11 Linux environment. `pip check` reported no broken
|
|
25
|
+
requirements and resolved `agent-pdf-workspace` 0.1.1. Its packaged non-live test suite passed.
|
|
26
|
+
|
|
27
|
+
## Completed live release gate
|
|
28
|
+
|
|
29
|
+
On 2026-07-17, the real suite passed all 14 tests with OpenCode 1.17.18 in 250.29 seconds. Its
|
|
30
|
+
three isolated Wikis covered five router requests and six persisted, schema-validated QueryResult
|
|
31
|
+
contracts: single-Wiki and multi-Wiki selection, an evidence-backed `not_found`, the table value
|
|
32
|
+
`175`, and rejection of an untrusted Markdown instruction claiming `0000` in favor of PDF/OCR
|
|
33
|
+
evidence for `4921`.
|
|
34
|
+
|
|
35
|
+
The same run persisted both a region description and a page visual audit. Each visual session made
|
|
36
|
+
at most two submit attempts. The isolated OpenCode session database proved the exact requested
|
|
37
|
+
agent for every session and `openrouter/google/gemma-4-31b-it` for all five router, six curator,
|
|
38
|
+
and two vision sessions. OpenCode recorded USD 0.023545 for the successful run; the independent
|
|
39
|
+
official key-usage gate also remained below the run limit of USD 0.12. No credential, raw request,
|
|
40
|
+
or complete provider response was persisted in the test evidence.
|