owfadev 0.0.1 → 0.3.1

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.
Files changed (101) hide show
  1. package/.agents/skills/asset-read/SKILL.md +39 -0
  2. package/.agents/skills/check/SKILL.md +130 -0
  3. package/.agents/skills/docs/SKILL.md +24 -0
  4. package/.agents/skills/map/SKILL.md +72 -0
  5. package/.agents/skills/plugin/SKILL.md +74 -0
  6. package/.agents/skills/profile/SKILL.md +75 -0
  7. package/.agents/skills/query/SKILL.md +48 -0
  8. package/.agents/skills/save/SKILL.md +94 -0
  9. package/.agents/skills/wiki_plugin_kernel/SKILL.md +104 -0
  10. package/.meta/VERSION +1 -0
  11. package/.meta/command/asset-read/SKILL.md +39 -0
  12. package/.meta/command/check/SKILL.md +130 -0
  13. package/.meta/command/docs/SKILL.md +24 -0
  14. package/.meta/command/map/SKILL.md +72 -0
  15. package/.meta/command/plugin/SKILL.md +74 -0
  16. package/.meta/command/profile/SKILL.md +75 -0
  17. package/.meta/command/query/SKILL.md +48 -0
  18. package/.meta/command/save/SKILL.md +94 -0
  19. package/.meta/command/wiki_plugin_kernel/SKILL.md +104 -0
  20. package/.meta/docs/agent-behavior.md +68 -0
  21. package/.meta/docs/agents-example.md +34 -0
  22. package/.meta/docs/conversion.md +24 -0
  23. package/.meta/docs/deployment.md +311 -0
  24. package/.meta/docs/developer.md +33 -0
  25. package/.meta/docs/distribution.md +132 -0
  26. package/.meta/docs/intro.md +56 -0
  27. package/.meta/docs/log-example.md +19 -0
  28. package/.meta/docs/map.md +23 -0
  29. package/.meta/docs/mechanics.md +180 -0
  30. package/.meta/docs/naming.md +113 -0
  31. package/.meta/docs/packages.md +140 -0
  32. package/.meta/docs/quickstart.md +79 -0
  33. package/.meta/docs/research-landscape.md +132 -0
  34. package/.meta/docs/research-user-profile.md +27 -0
  35. package/.meta/docs/sandbox.md +40 -0
  36. package/.meta/docs/usage.md +45 -0
  37. package/.meta/plugins/core/calendar/PLUGIN.md +35 -0
  38. package/.meta/plugins/core/calendar/PLUGIN.yaml +21 -0
  39. package/.meta/plugins/core/cron/PLUGIN.md +38 -0
  40. package/.meta/plugins/core/cron/PLUGIN.yaml +24 -0
  41. package/.meta/plugins/core/device/PLUGIN.md +38 -0
  42. package/.meta/plugins/core/device/PLUGIN.yaml +21 -0
  43. package/.meta/plugins/core/device/scripts/check.py +29 -0
  44. package/.meta/plugins/core/domain/PLUGIN.md +43 -0
  45. package/.meta/plugins/core/domain/PLUGIN.yaml +8 -0
  46. package/.meta/plugins/core/hot/PLUGIN.md +40 -0
  47. package/.meta/plugins/core/hot/PLUGIN.yaml +15 -0
  48. package/.meta/plugins/core/index/PLUGIN.md +39 -0
  49. package/.meta/plugins/core/index/PLUGIN.yaml +18 -0
  50. package/.meta/plugins/core/instance-git/PLUGIN.md +39 -0
  51. package/.meta/plugins/core/instance-git/PLUGIN.yaml +15 -0
  52. package/.meta/plugins/core/instance-git/scripts/check.py +90 -0
  53. package/.meta/plugins/core/language/PLUGIN.md +38 -0
  54. package/.meta/plugins/core/language/PLUGIN.yaml +23 -0
  55. package/.meta/plugins/core/language/scripts/check.py +23 -0
  56. package/.meta/plugins/core/link/PLUGIN.md +39 -0
  57. package/.meta/plugins/core/link/PLUGIN.yaml +16 -0
  58. package/.meta/plugins/core/link/scripts/check.py +122 -0
  59. package/.meta/plugins/core/log/PLUGIN.md +58 -0
  60. package/.meta/plugins/core/log/PLUGIN.yaml +18 -0
  61. package/.meta/plugins/core/log/scripts/check.py +21 -0
  62. package/.meta/plugins/core/mapping/PLUGIN.md +32 -0
  63. package/.meta/plugins/core/mapping/PLUGIN.yaml +24 -0
  64. package/.meta/plugins/core/mapping/scripts/check.py +90 -0
  65. package/.meta/plugins/core/notes/PLUGIN.md +42 -0
  66. package/.meta/plugins/core/notes/PLUGIN.yaml +19 -0
  67. package/.meta/plugins/core/sessions/PLUGIN.md +63 -0
  68. package/.meta/plugins/core/sessions/PLUGIN.yaml +20 -0
  69. package/.meta/plugins/core/sessions/scripts/check.py +33 -0
  70. package/.meta/plugins/core/structure/PLUGIN.md +29 -0
  71. package/.meta/plugins/core/structure/PLUGIN.yaml +18 -0
  72. package/.meta/plugins/core/structure/scripts/check.py +32 -0
  73. package/.meta/plugins/core/tag/PLUGIN.md +37 -0
  74. package/.meta/plugins/core/tag/PLUGIN.yaml +18 -0
  75. package/.meta/plugins/core/tag/scripts/check.py +28 -0
  76. package/.meta/plugins/core/tmp/PLUGIN.md +26 -0
  77. package/.meta/plugins/core/tmp/PLUGIN.yaml +16 -0
  78. package/.meta/plugins/core/todo/PLUGIN.md +33 -0
  79. package/.meta/plugins/core/todo/PLUGIN.yaml +22 -0
  80. package/.meta/plugins/core/trust/PLUGIN.md +70 -0
  81. package/.meta/plugins/core/trust/PLUGIN.yaml +23 -0
  82. package/.meta/plugins/core/trust/scripts/check.py +77 -0
  83. package/.meta/plugins/core/user-profile/PLUGIN.md +39 -0
  84. package/.meta/plugins/core/user-profile/PLUGIN.yaml +30 -0
  85. package/.meta/plugins/core/vault/PLUGIN.md +28 -0
  86. package/.meta/plugins/core/vault/PLUGIN.yaml +13 -0
  87. package/.meta/plugins/core/wiki/PLUGIN.md +37 -0
  88. package/.meta/plugins/core/wiki/PLUGIN.yaml +8 -0
  89. package/.meta/protocol/actions.md +42 -0
  90. package/.meta/protocol/experiments.md +40 -0
  91. package/.meta/protocol/registry.yaml +75 -0
  92. package/.meta/scripts/pipeline.py +428 -0
  93. package/.meta/scripts/wiki_plugin_kernel.py +1891 -0
  94. package/.meta/scripts/wikilib.py +79 -0
  95. package/.meta/tests/test_install_preflight.py +177 -0
  96. package/LICENSE +21 -21
  97. package/README.md +96 -15
  98. package/README.zh-CN.md +103 -0
  99. package/bin/owfa.js +594 -0
  100. package/package.json +36 -7
  101. package/templates/AGENTS.template.md +19 -0
@@ -0,0 +1,79 @@
1
+ #!/usr/bin/env python3
2
+ # -*- coding: utf-8 -*-
3
+ """Wiki page-service load-bearing piece: frontmatter parsing and page traversal, assembled into ctx for the attached-audit runtime.
4
+
5
+ Plugin attached-audit scripts do not import this module themselves —
6
+ wiki_plugin_kernel.audit scans wiki/ in a single pass and puts the (relative path,
7
+ frontmatter, body) list into ctx.pages for everyone to share (frugal invocation).
8
+ The same minimal YAML subset as wiki_plugin_kernel.parse_manifest, but with a
9
+ different tolerance policy: manifests fail loudly (protocol artifacts), page
10
+ frontmatter skips bad lines (user content must not crash attached audits over
11
+ format blemishes). Keys are lenient (anything non-blank and colon-free):
12
+ block-mapping subkeys may be directory names, Chinese, etc. (a proven need of the
13
+ structure declaration page); top-level protocol fields remain ASCII.
14
+ """
15
+ import os
16
+ import re
17
+
18
+
19
+ def _strip_quotes(s):
20
+ return s[1:-1] if len(s) >= 2 and s[0] == '"' and s[-1] == '"' else s
21
+
22
+
23
+ def _strip_comment(s):
24
+ return re.split(r"\s+#", s, maxsplit=1)[0].strip()
25
+
26
+
27
+ def parse_frontmatter(text):
28
+ """Parse the minimal YAML subset inside the --- fence; returns an empty dict without a fence, skips bad lines."""
29
+ m = re.match(r"^---\n(.*?)\n---", text, re.S)
30
+ if not m:
31
+ return {}
32
+ data, target = {}, None
33
+ for raw in m.group(1).splitlines():
34
+ if not raw.strip() or raw.lstrip().startswith("#"):
35
+ continue
36
+ if raw.startswith(" - "):
37
+ item = _strip_quotes(_strip_comment(raw.strip()[2:]).strip())
38
+ if not isinstance(data.get(target), list):
39
+ data[target] = []
40
+ data[target].append(item)
41
+ continue
42
+ mm = re.match(r"^(\s*)([^:\s][^:]*):\s*(.*)$", raw)
43
+ if not mm:
44
+ continue
45
+ key, val = mm.group(2), _strip_comment(mm.group(3))
46
+ if mm.group(1):
47
+ if not isinstance(data.get(target), dict):
48
+ data[target] = {}
49
+ data[target][key] = _strip_quotes(val)
50
+ else:
51
+ target = key
52
+ if val == "":
53
+ data[key] = None
54
+ elif val.startswith("[") and val.endswith("]"):
55
+ inner = val[1:-1].strip()
56
+ # strip whitespace before unquoting tokens: in [ai, llm] the second item carries a leading space; not stripping it fragments the vocabulary
57
+ data[key] = ([_strip_quotes(v.strip()) for v in inner.split(",") if v.strip()]
58
+ if inner else [])
59
+ else:
60
+ data[key] = _strip_quotes(val)
61
+ return data
62
+
63
+
64
+ def walk_pages(root):
65
+ """Walk all md pages under wiki/, yielding (wiki-relative path, frontmatter dict, body str)."""
66
+ wiki = os.path.join(root, "wiki")
67
+ for dirpath, dirs, files in os.walk(wiki):
68
+ dirs.sort()
69
+ for fn in sorted(files):
70
+ if not fn.endswith(".md"):
71
+ continue
72
+ p = os.path.join(dirpath, fn)
73
+ try:
74
+ text = open(p, encoding="utf-8").read()
75
+ except UnicodeDecodeError:
76
+ text = open(p, encoding="utf-8", errors="replace").read()
77
+ m = re.match(r"^---\n.*?\n---\n?", text, re.S)
78
+ rel = os.path.relpath(p, wiki).replace(os.sep, "/")
79
+ yield rel, parse_frontmatter(text), (text[m.end():] if m else text)
@@ -0,0 +1,177 @@
1
+ """Offline install regressions; synthetic packages and disposable instances only.
2
+
3
+ Run: python -m unittest discover -s .meta/tests -p test_install_preflight.py -v
4
+ """
5
+ import hashlib
6
+ import json
7
+ import os
8
+ from pathlib import Path
9
+ import shutil
10
+ import subprocess
11
+ import sys
12
+ import tempfile
13
+ import unittest
14
+
15
+
16
+ FRAMEWORK = Path(__file__).resolve().parents[2]
17
+
18
+
19
+ class InstallPreflightTests(unittest.TestCase):
20
+ def setUp(self):
21
+ self.temp = tempfile.TemporaryDirectory(prefix="kernel-install-test-")
22
+ self.addCleanup(self.temp.cleanup)
23
+ self.root = Path(self.temp.name) / "instance"
24
+ self.root.mkdir()
25
+ for directory in (".meta", ".agents"):
26
+ shutil.copytree(FRAMEWORK / directory, self.root / directory,
27
+ ignore=shutil.ignore_patterns("__pycache__", "tests", "smoke-tmp"))
28
+ (self.root / "AGENTS.md").write_text(
29
+ "# Synthetic instance\n<!-- wiki-inject:start -->\n<!-- wiki-inject:end -->\n",
30
+ encoding="utf-8")
31
+ self.source = Path(self.temp.name) / "source"
32
+ self.source.mkdir()
33
+ self.env = dict(os.environ, PYTHONDONTWRITEBYTECODE="1", PYTHONIOENCODING="utf-8")
34
+ self.env.pop("PYTHONPATH", None)
35
+ result = self.run_kernel("all")
36
+ self.assertEqual(result.returncode, 0, result.stdout + result.stderr)
37
+
38
+ def run_kernel(self, *args):
39
+ return subprocess.run(
40
+ [sys.executable, str(self.root / ".meta/scripts/wiki_plugin_kernel.py"), *args],
41
+ cwd=self.root, env=self.env, capture_output=True, text=True, encoding="utf-8")
42
+
43
+ def run_code(self, code):
44
+ prefix = "import sys; sys.path.insert(0, '.meta/scripts'); import wiki_plugin_kernel as k; "
45
+ return subprocess.run([sys.executable, "-c", prefix + code], cwd=self.root,
46
+ env=self.env, capture_output=True, text=True, encoding="utf-8")
47
+
48
+ def manifest(self, name, inject, depends="[domain, wiki, trust, log]", tier=None):
49
+ directory = self.source / name
50
+ directory.mkdir(exist_ok=True)
51
+ dependencies = "".join(f" - {item.strip()}\n" for item in depends.strip("[]").split(","))
52
+ text = (f"id: {name}\nschema_version: 1\nversion: 0.1\nupdated: 2026-10-24\n"
53
+ f"depends:\n{dependencies}attachment: []\nfields:\n"
54
+ f"inject: {json.dumps(inject, ensure_ascii=False)}\n")
55
+ if tier:
56
+ text += f"inject_tier: {tier}\n"
57
+ (directory / "PLUGIN.yaml").write_text(text, encoding="utf-8")
58
+ (directory / "PLUGIN.md").write_text("# Synthetic test plugin\n", encoding="utf-8")
59
+
60
+ def package(self, inject="Synthetic test", members="[probe]"):
61
+ (self.source / "PKG.yaml").write_text(
62
+ "schema_version: 1\nid: probe\nversion: 0.1\ncompat: '>= 0.3'\n"
63
+ f"members: {members}\ndepends: [framework]\n", encoding="utf-8")
64
+ self.manifest("probe", inject)
65
+
66
+ def install(self, *extra):
67
+ return self.run_kernel("install", "probe", "--path", str(self.source), *extra)
68
+
69
+ def snapshot(self):
70
+ return {str(path.relative_to(self.root)): hashlib.sha256(path.read_bytes()).hexdigest()
71
+ for path in self.root.rglob("*") if path.is_file()}
72
+
73
+ def budget_text(self, extra=0):
74
+ result = self.run_code(
75
+ "p,e=k.load_plugins(); assert not e; b,_=k.build_inject_blocks(p); "
76
+ "print(k.INJECT_BUDGET-sum(len(x.encode('utf-8')) for x in b))")
77
+ self.assertEqual(result.returncode, 0, result.stderr)
78
+ overhead = len("<!-- plugin:probe v0.1 -->\n- \n<!-- /plugin:probe -->".encode("utf-8"))
79
+ room = int(result.stdout.strip()) - overhead + extra
80
+ return "界" * (room // 3) + "x" * (room % 3)
81
+
82
+ def test_over_budget_leaves_all_instance_state_unchanged(self):
83
+ self.package(self.budget_text(extra=1))
84
+ # These would all land or change if rejection happened after copy/staging.
85
+ for relative in ("connectors/test-connector/file.txt", "command/test-command/file.txt",
86
+ "migrations/init.md"):
87
+ path = self.source / relative
88
+ path.parent.mkdir(parents=True, exist_ok=True)
89
+ path.write_text("Synthetic payload", encoding="utf-8")
90
+ ledger = self.root / ".meta/migrations/pending.json"
91
+ ledger.parent.mkdir(exist_ok=True)
92
+ ledger.write_text(json.dumps({"probe": {"kind": "teardown", "items": []}}), encoding="utf-8")
93
+ before = self.snapshot()
94
+ result = self.install()
95
+ self.assertEqual(result.returncode, 1, result.stdout + result.stderr)
96
+ self.assertIn("over the 16384 B budget", result.stdout)
97
+ self.assertIn("preflight failed", result.stdout)
98
+ self.assertEqual(self.snapshot(), before)
99
+ self.assertTrue((self.source / "probe/PLUGIN.yaml").exists())
100
+
101
+ def test_exact_utf8_budget_installs_and_converges(self):
102
+ self.package(self.budget_text())
103
+ result = self.install()
104
+ self.assertEqual(result.returncode, 0, result.stdout + result.stderr)
105
+ self.assertIn("plugin:probe", (self.root / "AGENTS.md").read_text(encoding="utf-8"))
106
+ result = self.run_kernel("all")
107
+ self.assertEqual(result.returncode, 0, result.stdout + result.stderr)
108
+
109
+ def test_without_cascade_uses_only_the_installed_subset(self):
110
+ self.package(members="[probe, optional, child]")
111
+ self.manifest("optional", "界" * 6000, depends="[probe]")
112
+ self.manifest("child", "界" * 6000, depends="[optional]")
113
+ result = self.install("--without", "optional")
114
+ self.assertEqual(result.returncode, 0, result.stdout + result.stderr)
115
+ installed = self.root / ".meta/plugins/domains/probe"
116
+ self.assertFalse((installed / "optional").exists())
117
+ self.assertFalse((installed / "child").exists())
118
+ self.assertEqual(self.run_kernel("validate").returncode, 0)
119
+
120
+ def test_member_tier_does_not_consume_injection_budget(self):
121
+ self.package(members="[probe, member]")
122
+ self.manifest("member", "界" * 6000, depends="[probe]", tier="member")
123
+ result = self.install()
124
+ self.assertEqual(result.returncode, 0, result.stdout + result.stderr)
125
+ self.assertNotIn("plugin:member", (self.root / "AGENTS.md").read_text(encoding="utf-8"))
126
+
127
+ def test_duplicate_installed_id_is_rejected_before_copy(self):
128
+ self.package(members="[probe, language]")
129
+ self.manifest("language", "Duplicate", depends="[probe]")
130
+ before = self.snapshot()
131
+ result = self.install()
132
+ self.assertEqual(result.returncode, 1, result.stdout + result.stderr)
133
+ self.assertIn("duplicate plugin id", result.stdout)
134
+ self.assertEqual(self.snapshot(), before)
135
+
136
+ def test_post_copy_binding_failure_returns_nonzero_and_warns(self):
137
+ self.package()
138
+ path = self.source / "probe/PLUGIN.yaml"
139
+ path.write_text(path.read_text(encoding="utf-8") + "commands:\n - missing-command\n", encoding="utf-8")
140
+ result = self.install()
141
+ self.assertEqual(result.returncode, 1, result.stdout + result.stderr)
142
+ self.assertIn("install incomplete", result.stdout)
143
+ self.assertIn("missing command", result.stdout)
144
+ self.assertTrue((self.root / ".meta/plugins/domains/probe/PKG.yaml").exists())
145
+
146
+ def test_projection_failure_returns_nonzero(self):
147
+ self.package()
148
+ (self.root / "AGENTS.md").write_text("# Missing injection markers\n", encoding="utf-8")
149
+ result = self.install()
150
+ self.assertEqual(result.returncode, 1, result.stdout + result.stderr)
151
+ self.assertIn("projection failed (do_inject)", result.stdout)
152
+ self.assertIn("install incomplete", result.stdout)
153
+
154
+ def test_semantic_init_stays_pending_without_becoming_mechanical_failure(self):
155
+ self.package()
156
+ migration = self.source / "migrations/init.md"
157
+ migration.parent.mkdir()
158
+ migration.write_text("# Synthetic manual initialization\n", encoding="utf-8")
159
+ result = self.install()
160
+ self.assertEqual(result.returncode, 0, result.stdout + result.stderr)
161
+ self.assertIn("semantic migration staged", result.stdout)
162
+ result = self.run_kernel("validate")
163
+ self.assertEqual(result.returncode, 1, result.stdout + result.stderr)
164
+ self.assertIn("pending semantic migration", result.stdout)
165
+
166
+ def test_deploy_failure_is_propagated(self):
167
+ self.package()
168
+ result = self.run_code(
169
+ "k.do_deploy=lambda: False; "
170
+ f"sys.exit(k.do_install('probe', ['--path', {str(self.source)!r}]))")
171
+ self.assertEqual(result.returncode, 1, result.stdout + result.stderr)
172
+ self.assertIn("deployment failed", result.stdout)
173
+ self.assertIn("install incomplete", result.stdout)
174
+
175
+
176
+ if __name__ == "__main__":
177
+ unittest.main()
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 AIE3905-Wuwa
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 AIE3905-Wuwa
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,23 +1,104 @@
1
- # owfadev
1
+ # OWFA — One Workspace For All (agents)
2
2
 
3
- **One Workspace For All (agents).**
3
+ > English | [简体中文](README.zh-CN.md)
4
4
 
5
- This is the **interim distribution package** for the owfa project.
5
+ > **OWFA** is the project; **OWFA Core** is the framework body (formerly `vault-wiki`); **OWFA CLI** is the installer. The public home is moving to **`owfadev/owfa`** — `github.com/owfa` is an unrelated organization. The npm name `owfa` is under application; see [The name](#the-name).
6
6
 
7
- ## Why `owfadev` and not `owfa`?
7
+ **OWFA** (One Workspace For All agents) is an open-source agent workspace: out-of-the-box on first install, continuously maintainable over time, and pluginized end to end. One workspace — the directory you own, holding `vault/` (real assets), `wiki/` (md proxies and native notes) and `AGENTS.md` (the constitution) — is the standing context that every agent you use re-enters instead of being re-introduced each session. The agent reads and writes with zero priors per the SASU-L disclosure order; md plus plain files are the foundation, and Obsidian and friends are replaceable viewers. Behavior is personalizable through a living user profile, and new capabilities land as plugins — every plugin ships through the registry with a human-review gate, so contributions are welcome: build a domain plugin for the sources you use and file a one-line PR to list it (see [Contributing](#contributing)).
8
8
 
9
- npm's package-name similarity policy currently blocks publishing the bare name `owfa`
10
- (deemed too similar to the existing packages `ow` and `ora`). A name-review appeal is
11
- filed with npm. Until it resolves, `owfadev` is the official distribution channel:
9
+ > Status: **alpha** — capability-wise a prototype matured by six weeks of real daily use (born 2026-09-08, validated by two rounds of real operation plus a cold-start disclosure audit, the bb course family live across four courses); distribution-wise v0.3 is the first shape others can install — covered by exactly one fresh-instance acceptance run, zero outside users. Beta gate: behavior contracts (#34) landed · both members running real installs · the legacy-instance conversion walked through · the acceptance script replayable green. `.meta/VERSION` tracks the kernel contract, not product maturity — stage labels live here and in release notes. Universalization and matrix testing remain deferred. Converted from personal use to a team project on 2026-10-02. Docs language switched to English on 2026-10-06 (historical Chinese log entries preserved as-is). 2026-10-12: repo transferred to the GitHub org **AIE3905-Wuwa**; the standardization-and-split improvement phase opened — package binding landed (core 20 + 5 domain packages, see [.meta/docs/packages.md](https://github.com/owfadev/owfa/blob/master/.meta/docs/packages.md)); dev rules now live in [CONTRIBUTING.md](https://github.com/owfadev/owfa/blob/master/CONTRIBUTING.md). 2026-10-13: VERSION 0.3 (tag v0.3) — registry discovery/install, subset installs (--without), upgrade chaining, teardown (x->0) closing the migration algebra, the instance git contract; validated end-to-end by a fresh-instance acceptance run. 2026-10-25: the framework body gets a distribution channel of its own — npm CLI `owfa` (`init` / `upgrade` / `doctor` / `add`), closing the "clone + copy two trees + hand-write AGENTS.md" gap (issues #45/#46); the npm name `owfa` is frozen under the registry's similarity policy and is under application, with `owfadev` as the fallback namespace.
12
10
 
13
- - If the appeal succeeds, this package will be deprecated in favor of `owfa`.
14
- - If not, `owfadev` stays the distribution name.
11
+ ## The name
15
12
 
16
- ## What's coming
13
+ **OWFA — One Workspace For All (agents).** One workspace — the directory you own, holding `vault/`, `wiki/`, `AGENTS.md` and the framework body — that every agent you use re-enters instead of being re-introduced each session. *All* means all of *your* agents, not all people and not a hosted service; the human stays the owner and the audit anchor. `vault-wiki` retires from the public surface: public copy says **OWFA** (or **OWFA Core**), the GitHub home moves to **`owfadev/owfa`**, and `owfa` is the name the CLI ships under. That last address is not free yet — npm froze `owfa` as too similar to `ow`/`ora`; an application is in progress, and `owfadev` is the fallback package. Full rationale, layers and collision policy: [`.meta/docs/naming.md`](https://github.com/owfadev/owfa/blob/master/.meta/docs/naming.md).
17
14
 
18
- An agent knowledge-base framework: `vault/` holds real assets, `wiki/` keeps md proxies
19
- and native notes, and an AI coding agent tends it for you (map / save / query / check).
20
- Bootstrap target: `npx owfadev init`.
15
+ ## What it does
16
+
17
+ Let an AI coding agent run a "personal wiki" for you:
18
+
19
+ - Drop assets into `vault/`, any format — md, txt, csv, pdf, images. The **map** command registers each as an md proxy page under `wiki/vault/`, with SHA-256, metadata and links
20
+ - Insights and decisions from conversations are distilled by the **save** command into native notes under `wiki/notes/`; session backbone pages go to `wiki/sessions/`
21
+ - The **query** command reads the hot cache and indexes first, then answers with wikilink-cited results
22
+ - Index, tags, hot cache and the run log are all maintained automatically by the derived layer; the **check** command audits library health; the **plugin** command installs/uninstalls structural plugins
23
+ - External sources attach as domains: lark and email land as pointers or archive pages; calendar manages the timeline; project manages project containers; bb pulls courseware, assignments and grades via bb-cli; bilibili answers on demand via bili-cli (search/details/favorites/UP tracking; video summaries and reviews archived on explicit request; low-risk write whitelist behind explicit user verbs). Translation happens outside domains; inside the wiki everything interlinks
24
+ - The **profile** command maintains a living cognition file about the user: assertions carry evidence, preferences expire; read it before any personalization
25
+ - The **teach** command explains per the cognition profile — skim or quiz the known, unpack the unknown; significant Q&A settles into ai notes
26
+ - The **quiz** command generates practice from a scope plus optional samples; grading flows back into the cognition profile
27
+ - The **track** command reads/writes per-course user.md learning state; teach and quiz usage mounts here
28
+
29
+ ## Core concepts
30
+
31
+ | Concept | Definition |
32
+ |---|---|
33
+ | wiki | the md world, the inner side of the inner/outer divide: per-domain projections + native notes + derived layer |
34
+ | domain | the adapter contract for an information source outside the wiki. vault is the default domain; lark, project, email, bb, bili are domains too |
35
+ | vault | the default domain — the real-asset repository; command side append-only, deletion & editing belong to the human |
36
+ | SASU-L | the disclosure paradigm: the agent learns only via system prompt, AGENTS.md, Skills, user's words, loop |
37
+
38
+ ## Layout
39
+
40
+ | Directory | Contents |
41
+ |------|------|
42
+ | `.meta/` | Prototype core, two-level plugin layout: `plugins/core/` (20 framework plugins — the two conceptual roots domain and wiki, cross-cutting pieces, and the explicit vault/mapping/structure constitutional exception) + `plugins/domains/<pkg>/` (one package per directory: `PKG.yaml` + family masters — cuhksz 8, lark 4, email, bili, project). Directory boundary == tier boundary == package boundary; `PKG.yaml` declares the roster and the kernel reconciles it against the family closure; `.meta/VERSION` anchors the framework version (package `compat` floors checked against it). Injection order = dependency topology + alphabetical; the AGENTS injection region is tiered — member-tier domain pieces exit it (family roster + skills + on-demand manifest reads carry exposure) under a kernel byte budget; global plugins may declare bridges, and mandatory bridges are kernel-verified. Also 13 command masters, protocol artifacts — registry, actions, experiments — and the mechanical scripts wiki_plugin_kernel, pipeline, wikilib, pure stdlib with zero deps |
43
+ | `connectors/` | Connector masters: deployment-side CLI factual interface + skill usage disclosure. `connectors/*/SKILL.md` lands in `.agents/skills/` via kernel deploy; currently bb-cli, sis-cli, mail-cli, bili-cli. Connectors ride with their packages in `PKG.yaml` — physical relocation into the per-package repos happens at the split round |
44
+ | Packages | The index lives in the [registry](https://github.com/owfadev/registry) (Obsidian-model: self-hosted packages, one-line PR is the listing gate). `kernel install`/`list-remote` resolve against it; unindexed repos stay installable with `--yes` (trust: unknown). The org repos `pkg-cuhksz` / `pkg-lark` / `pkg-email` / `pkg-bili` / `pkg-project` / `pkg-github` hold the packages, split with full file lineage |
45
+ | `.agents/skills/` | Deployment copies of command & connector skills (framework commands after the split; connector skills arrive with their packages) |
46
+ | `bin/` + `templates/` + `package.json` | The npm channel: `owfa` CLI, AGENTS seed, package manifest. `test/` and `scripts/` are development-only and never ship |
47
+ | `test-repo/` | Local test sandbox — untracked since 2026-10-13 (owner re-ruling; a fresh clone carries none of it). A scratch deployment for experiments needing an AGENTS.md context; setup and rules in [`.meta/docs/sandbox.md`](https://github.com/owfadev/owfa/blob/master/.meta/docs/sandbox.md). The framework repo itself carries no AGENTS.md — library posture; dev rules live in [CONTRIBUTING.md](https://github.com/owfadev/owfa/blob/master/CONTRIBUTING.md) |
48
+ | `.meta/docs/` | Human docs: `intro.md` introduction, `mechanics.md` mechanics, `usage.md` usage guide, `deployment.md` full guide / `quickstart.md` five-minute path, `instance-git.md` the instance-side git minimal contract, `research-*.md` research files — direct links at the end. Authoritative mechanics live in the kernel reference skill; docs do not mirror mechanics |
49
+
50
+ ## Contributing
51
+
52
+ Contributions are welcome, and plugins are the intended surface: a new capability is a new plugin, not a fork of the framework. Three paths, smallest first — a connector skill for a CLI you use, a domain plugin that adapts an external source to the wiki (see [`developer.md`](https://github.com/owfadev/owfa/blob/master/.meta/docs/developer.md) for the three-path table and the dev loop), or an improvement to core. Domain packages self-host in their own repos; listing is a one-line PR to the [registry](https://github.com/owfadev/registry), which is the human-review trust gate. Bug reports and behavior questions go through issues; the framework body itself takes PRs.
53
+
54
+ ## Collaboration
55
+
56
+ This repository is a team project: three members with write access, everything through PRs (1 approving review to merge, `enforce_admins` on); the owner holds final say on repo settings, permissions and charter/kernel changes. Data red lines, commit flow and version discipline are summarized in [CONTRIBUTING.md](https://github.com/owfadev/owfa/blob/master/CONTRIBUTING.md) — the authoritative dev rules; the change trail is git history + PRs + issues (the repo keeps no run log).
57
+
58
+ ## Getting started
59
+
60
+ Two ways in. **Channel (recommended):** `npx owfa init my-workspace` — Node 16.7+ for the installer, Python 3.9+ for Core; nothing to clone (`npx owfadev init` is the fallback while the npm name is under application). **Manual:** clone this repository and follow the five steps in [quickstart.md](https://github.com/owfadev/owfa/blob/master/.meta/docs/quickstart.md), then `python .meta/scripts/wiki_plugin_kernel.py all`. Full guide, including packages and upgrades: [deployment.md](https://github.com/owfadev/owfa/blob/master/.meta/docs/deployment.md).
61
+
62
+ Prerequisites: Python 3.9+, pure stdlib, no install needed for the framework itself (connectors carry their own deps); Node 16.7+ only for the npm channel; git recommended (instance snapshots); an agent environment that reads AGENTS.md and skills, e.g. ZCode; Obsidian optional, viewer only.
63
+
64
+ Open an agent session at the repository root. AGENTS.md is the constitution, containing the plugin injection region; the thirteen commands trigger by natural language: **map / save / profile / query / check / plugin / lark-map / bb-map / asset-read / kernel reference / teach / quiz / track** — map, save, profile, query, check, plugin, lark-map, bb-map, asset-read, wiki_plugin_kernel, bb-teach, bb-quiz, bb-track; masters live in `.meta/command/`. Put a file into `vault/` and say "map" to the agent — that is the first use.
65
+
66
+ ## Deployment
67
+
68
+ OWFA has three layers: **OWFA CLI** (the installer, never copied into the workspace), **OWFA Core** (`.meta/` + `.agents/skills/`, the thing that is installed), and the **kernel** (a pure-stdlib Python script inside Core — there is no separate kernel install; Python 3.9+ runs it). Domain packages under `.meta/plugins/domains/<pkg>/` are optional.
69
+
70
+ ```bash
71
+ npx owfa init my-workspace # target name; npx owfadev init while the application is pending
72
+ cd my-workspace
73
+ npx owfa doctor # target: python / framework / markers / kernel validate (npx owfadev doctor for the fallback)
74
+ npx owfa list # registry catalog
75
+ npx owfa add cuhksz # optional package
76
+ npx owfa upgrade # later: replace the framework trees, preserve instance state
77
+ ```
78
+
79
+ While the name is under application, substitute `npx owfadev` for every `npx owfa` command above (or install either package globally; both expose the `owfa` bin).
80
+
81
+ `init` is additive: existing content is untouched, an existing `AGENTS.md` is preserved and only the injection region is appended. `upgrade` replaces `.meta/` and `.agents/skills/` (instance data is never touched) and keeps the kernel's migration ledger, journal and registry cache.
82
+
83
+ - Full deployment guide (components, channels, packages, upgrades, troubleshooting): [`.meta/docs/deployment.md`](https://github.com/owfadev/owfa/blob/master/.meta/docs/deployment.md)
84
+ - Five-minute path: [`.meta/docs/quickstart.md`](https://github.com/owfadev/owfa/blob/master/.meta/docs/quickstart.md)
85
+ - Channel design and release runbook: [`.meta/docs/distribution.md`](https://github.com/owfadev/owfa/blob/master/.meta/docs/distribution.md)
86
+
87
+ ## Doc pointers
88
+
89
+ - [.meta/docs/deployment.md](https://github.com/owfadev/owfa/blob/master/.meta/docs/deployment.md) — deployment guide: components, channels, first run, packages, upgrades, troubleshooting
90
+ - [.meta/docs/naming.md](https://github.com/owfadev/owfa/blob/master/.meta/docs/naming.md) — the name: canonical expansion, what each word commits to, two names two jobs, objections, collision policy
91
+ - [.meta/docs/distribution.md](https://github.com/owfadev/owfa/blob/master/.meta/docs/distribution.md) — the npm channel: commands, artifacts, version invariant, release runbook, security posture
92
+ - [.meta/docs/packages.md](https://github.com/owfadev/owfa/blob/master/.meta/docs/packages.md) — package mechanism and design rationale: layout, PKG.yaml, invariants, versions, uninstall contract, decision ledger
93
+ - [.meta/docs/developer.md](https://github.com/owfadev/owfa/blob/master/.meta/docs/developer.md) — developer guide: where a plugin lands (the three-path table), the dev loop, registration and discovery
94
+ - [.meta/docs/agents-example.md](https://github.com/owfadev/owfa/blob/master/.meta/docs/agents-example.md) / [.meta/docs/log-example.md](https://github.com/owfadev/owfa/blob/master/.meta/docs/log-example.md) — instance seeds for AGENTS.md and log.md (the framework repo itself carries neither)
95
+ - [.meta/docs/intro.md](https://github.com/owfadev/owfa/blob/master/.meta/docs/intro.md) — introduction: why this framework, narrative & lineage
96
+ - [.meta/docs/mechanics.md](https://github.com/owfadev/owfa/blob/master/.meta/docs/mechanics.md) — mechanics: each mechanism one level deeper, with a bb-family walkthrough; read before touching the framework
97
+ - [.meta/docs/usage.md](https://github.com/owfadev/owfa/blob/master/.meta/docs/usage.md) — usage guide: the three work loops (library keeping, course learning, collaborative development)
98
+ - [.meta/docs/quickstart.md](https://github.com/owfadev/owfa/blob/master/.meta/docs/quickstart.md) — five-minute path: one command or the manual five steps, then first run
99
+ - `.meta/protocol/` — field registry, action discipline, disclosure paradigm
100
+
101
+ ## License
102
+
103
+ MIT — see [LICENSE](https://github.com/owfadev/owfa/blob/master/LICENSE).
21
104
 
22
- - Source: <https://github.com/AIE3905-Wuwa/vault-wiki>
23
- - Status: alpha. Version will mirror the framework's `VERSION` once the real CLI lands.
@@ -0,0 +1,103 @@
1
+ # OWFA — One Workspace For All (agents)
2
+
3
+ > [English](README.md) | 简体中文
4
+
5
+ > **OWFA** 是项目名;**OWFA Core** 是框架本体(原 `vault-wiki`);**OWFA CLI** 是安装器。公开主页为 **`owfadev/owfa`**——`github.com/owfa` 是无关组织。npm 包名 `owfa` 正在申请中,详见[「关于命名」](#关于命名)。
6
+
7
+ **OWFA**(One Workspace For All agents)是一个开源的 agent 工作区:开箱即用、可持续维护、端到端插件化。一个工作区——你拥有的那个目录,装着 `vault/`(真实资产)、`wiki/`(md 投影与原生笔记)和 `AGENTS.md`(章程)——是你所有 agent 反复进入的常驻上下文,而不是每次会话重新自我介绍。agent 按 SASU-L 披露次序零先验地读写;md 与纯文本文件是地基,Obsidian 等只是可替换的查看器。行为通过一份活的用户画像个性化,新能力以插件落地——每个插件都经 registry 的人工审核门发布,欢迎贡献:为你使用的信息源写一个域插件,向 registry 提一行 PR 即可上架(见[参与贡献](#参与贡献))。
8
+
9
+ > 状态:**alpha**——能力面是经六周真实日常使用打磨出的原型(生于 2026-09-08,经两轮实际运营与一次冷启动披露审计检验,bb 课程家族在四门课真实运行);分发面 v0.3 是首个可安装形态——经一次全新实例验收,尚无外部用户。Beta 门槛:行为契约(#34)落地 · 两位成员真实装机 · 旧实例转换走通 · 验收脚本可重放绿。`.meta/VERSION` 锚定的是内核契约而非产品成熟度——阶段标签在这里与 release notes。2026-10-02 转为团队项目。文档语言 2026-10-06 起切换为英文。2026-10-25:框架本体有了自己的分发通道——npm CLI `owfa`(`init` / `upgrade` / `doctor` / `add`),补上「clone + 拷两棵树 + 手写 AGENTS.md」的缺口(issues #45/#46);npm 名 `owfa` 因相似性策略冻结,申请中,`owfadev` 为兜底命名空间。
10
+
11
+ ## 关于命名
12
+
13
+ **OWFA — One Workspace For All (agents)。** 一个工作区——你拥有的目录,装着 `vault/`、`wiki/`、`AGENTS.md` 与框架本体——你使用的每一个 agent 都重新进入它,而不是每次会话重新认识它。*All* 指的是*你的*所有 agent,不是所有人,也不是托管服务;人始终是所有者与审计锚点。`vault-wiki` 退出公开面:公开文案称 **OWFA**(或 **OWFA Core**),GitHub 家在 **`owfadev/owfa`**,CLI 以 `owfa` 之名发布。npm 地址尚未空闲——npm 以「与 `ow`/`ora` 过于相似」冻结了 `owfa`,申诉进行中,`owfadev` 为兜底包。完整的理据、分层与撞名对策:[`.meta/docs/naming.md`](https://github.com/owfadev/owfa/blob/master/.meta/docs/naming.md)。
14
+
15
+ ## 它做什么
16
+
17
+ 让 AI 编码 agent 替你经营一座「个人 wiki」:
18
+
19
+ - 资产随手丢进 `vault/`,任何格式——md、txt、csv、pdf、图片。**map** 命令把每件资产登记为 `wiki/vault/` 下的 md 投影页,带 SHA-256、元数据与链接
20
+ - 对话中的洞见与决策由 **save** 命令蒸馏为 `wiki/notes/` 下的原生笔记;会话骨架页进 `wiki/sessions/`
21
+ - **query** 命令先读热缓存与索引,再以 wikilink 引用作答
22
+ - 索引、标签、热缓存与运行日志由派生层自动维护;**check** 命令体检库健康;**plugin** 命令装卸结构插件
23
+ - 外部信息源以域接入:lark 与 email 落为指针或归档页;calendar 管时间线;project 管项目容器;bb 经 bb-cli 拉课件、作业与成绩;bilibili 经 bili-cli 按需应答(搜索/详情/收藏/UP 追更;视频摘要与评审经显式请求归档;低风险写白名单须用户显式动词)。翻译发生在域外;域内一切互链
24
+ - **profile** 命令维护一份关于用户的活认知档案:断言带证据,偏好会过期;任何个性化决策前先读它
25
+ - **teach** 命令按认知档案讲解——熟点略讲或抽测,生点拆解;重要问答沉淀进 ai notes
26
+ - **quiz** 命令按范围加可选样本出题;批改结果回流认知档案
27
+ - **track** 命令读写每门课的 user.md 学习状态;teach 与 quiz 的使用挂载于此
28
+
29
+ ## 核心概念
30
+
31
+ | 概念 | 定义 |
32
+ |---|---|
33
+ | wiki | md 世界,内外之分的内侧:各域投影 + 原生笔记 + 派生层 |
34
+ | domain | wiki 之外信息源的适配器契约。vault 是默认域;lark、project、email、bb、bili 也是域 |
35
+ | vault | 默认域——真实资产仓库;命令侧只增不删,删除与修改的自由属于人 |
36
+ | SASU-L | 披露范式:agent 只经系统提示、AGENTS.md、Skills、用户的话与循环来学习 |
37
+
38
+ ## 目录结构
39
+
40
+ | 目录 | 内容 |
41
+ |------|------|
42
+ | `.meta/` | 原型核心,两级插件布局:`plugins/core/`(20 个框架插件——domain 与 wiki 两个概念根、横切件,以及 vault/mapping/structure 的明示章程例外)+ `plugins/domains/<pkg>/`(一包一目录:`PKG.yaml` + 家族母本——cuhksz 8、lark 4、email、bili、project)。目录边界 == 层级边界 == 包边界;`PKG.yaml` 声明名册,内核对账家族闭包;`.meta/VERSION` 锚定框架版本(包 `compat` 下限对它校验)。注入次序 = 依赖拓扑 + 字典序;AGENTS 注入区分层——成员级域件退出注入区(家族名册 + 技能 + 按需 manifest 读取承担曝光),受内核字节预算约束;全局插件可声明桥,必依桥由内核校验。另有 13 个命令母本、协议工件(registry、actions、experiments)与机械脚本 wiki_plugin_kernel、pipeline、wikilib——纯标准库零依赖 |
43
+ | `connectors/` | 连接器母本:部署侧 CLI 事实接口 + 技能使用披露。`connectors/*/SKILL.md` 经内核 deploy 落入 `.agents/skills/`;现有 bb-cli、sis-cli、mail-cli、bili-cli。连接器随各自包的 `PKG.yaml` 走 |
44
+ | Packages | 索引在 [registry](https://github.com/owfadev/registry)(Obsidian 模式:包自托管于各自仓,一行 PR 即上架门)。`kernel install`/`list-remote` 对它解析;未入索引的仓 `--yes` 可装(trust: unknown)。组织仓 `pkg-cuhksz` / `pkg-lark` / `pkg-email` / `pkg-bili` / `pkg-project` / `pkg-github` 承载各包,带完整文件谱系拆分 |
45
+ | `.agents/skills/` | 命令与连接器技能的部署副本(拆分后框架命令在此;连接器技能随包到达) |
46
+ | `bin/` + `templates/` + `package.json` | npm 通道:`owfa` CLI、AGENTS 种子、包清单。`test/` 与 `scripts/` 仅供开发,不随包发布 |
47
+ | `test-repo/` | 本地测试沙盒——2026-10-13 起不入 git(owner 裁定;全新 clone 不含它)。需要 AGENTS.md 上下文的实验用临时部署;设置与规则见 [`.meta/docs/sandbox.md`](https://github.com/owfadev/owfa/blob/master/.meta/docs/sandbox.md)。框架仓自身不带 AGENTS.md——库姿态;开发规则在 [CONTRIBUTING.md](https://github.com/owfadev/owfa/blob/master/CONTRIBUTING.md) |
48
+ | `.meta/docs/` | 人读文档:`intro.md` 导论、`mechanics.md` 机制、`usage.md` 使用指南、`deployment.md` 全指南 / `quickstart.md` 五分钟路径、`instance-git.md` 实例侧 git 最小契约、`research-*.md` 研究文件——文末直链。权威机制在内核参考 skill;文档不复写机制 |
49
+
50
+ ## 参与贡献
51
+
52
+ 欢迎贡献,插件是预定贡献面:新能力是新插件,不是 fork 框架。三条路径,由小到大——为你使用的 CLI 写一个连接器技能;写一个把外部信息源适配进 wiki 的域插件(三路径表与开发循环见 [`developer.md`](https://github.com/owfadev/owfa/blob/master/.meta/docs/developer.md));或改进 core。域包自托管于各自仓;上架 = 向 [registry](https://github.com/owfadev/registry) 提一行 PR,那是人工审核的信任门。Bug 与行为问题走 issues;框架本体收 PR。
53
+
54
+ ## 协作
55
+
56
+ 本仓是团队项目:三名成员有写权限,一切经 PR(1 个 approving review 可合,`enforce_admins` 开启);owner 对仓库设置、权限与章程/内核变更有最终决定权。数据红线、提交流程与版本纪律 summarized 在 [CONTRIBUTING.md](https://github.com/owfadev/owfa/blob/master/CONTRIBUTING.md)——权威开发规则;变更轨迹是 git 历史 + PR + issues(本仓不留运行日志)。
57
+
58
+ ## 快速开始
59
+
60
+ 两条入口。**通道(推荐):** `npx owfa init my-workspace`——安装器要 Node 16.7+,Core 要 Python 3.9+;无需 clone(npm 名申请期间用 `npx owfadev init` 兜底)。**手动:** clone 本仓并按 [quickstart.md](https://github.com/owfadev/owfa/blob/master/.meta/docs/quickstart.md) 的五步走,然后 `python .meta/scripts/wiki_plugin_kernel.py all`。含包与升级的全指南:[deployment.md](https://github.com/owfadev/owfa/blob/master/.meta/docs/deployment.md)。
61
+
62
+ 前提:Python 3.9+,纯标准库,框架本身免安装(连接器自带依赖);仅 npm 通道要 Node 16.7+;推荐 git(实例快照);一个会读 AGENTS.md 与 skills 的 agent 环境,如 ZCode;Obsidian 可选,仅查看器。
63
+
64
+ 在仓库根开一个 agent 会话。AGENTS.md 是章程,含插件注入区;十三个命令经自然语言触发:**map / save / profile / query / check / plugin / lark-map / bb-map / asset-read / 内核参考 / teach / quiz / track**——map、save、profile、query、check、plugin、lark-map、bb-map、asset-read、wiki_plugin_kernel、bb-teach、bb-quiz、bb-track;母本在 `.meta/command/`。丢一个文件进 `vault/`,对 agent 说「map」——这就是第一次使用。
65
+
66
+ ## 部署
67
+
68
+ OWFA 有三层:**OWFA CLI**(安装器,绝不拷入工作区)、**OWFA Core**(`.meta/` + `.agents/skills/`,被安装之物)与 **kernel**(Core 内的纯标准库 Python 脚本——没有单独的内核安装;Python 3.9+ 即可运行)。`.meta/plugins/domains/<pkg>/` 下的域包是可选的。
69
+
70
+ ```bash
71
+ npx owfa init my-workspace # 目标名;申请期间用 npx owfadev init
72
+ cd my-workspace
73
+ npx owfa doctor # 体检:python / 框架 / 标记 / kernel validate(兜底用 npx owfadev doctor)
74
+ npx owfa list # registry 目录
75
+ npx owfa add cuhksz # 可选包
76
+ npx owfa upgrade # 日后:替换框架树,保留实例状态
77
+ ```
78
+
79
+ 名字申请期间,把上面每条 `npx owfa` 换成 `npx owfadev` 即可(或全局安装任一包;两者都暴露 `owfa` 命令)。
80
+
81
+ `init` 是加法的:既有内容不动,已有 `AGENTS.md` 保留、只追加注入区。`upgrade` 替换 `.meta/` 与 `.agents/skills/`(实例数据永不触碰),保留内核迁移台账、journal 与 registry 缓存。
82
+
83
+ - 全部署指南(组件、通道、包、升级、故障):[`.meta/docs/deployment.md`](https://github.com/owfadev/owfa/blob/master/.meta/docs/deployment.md)
84
+ - 五分钟路径:[`.meta/docs/quickstart.md`](https://github.com/owfadev/owfa/blob/master/.meta/docs/quickstart.md)
85
+ - 通道设计与发布手册:[`.meta/docs/distribution.md`](https://github.com/owfadev/owfa/blob/master/.meta/docs/distribution.md)
86
+
87
+ ## 文档索引
88
+
89
+ - [.meta/docs/deployment.md](https://github.com/owfadev/owfa/blob/master/.meta/docs/deployment.md) — 部署指南:组件、通道、首跑、包、升级、故障
90
+ - [.meta/docs/naming.md](https://github.com/owfadev/owfa/blob/master/.meta/docs/naming.md) — 命名:本义展开、每个词的承诺、两名两职、异议与撞名对策
91
+ - [.meta/docs/distribution.md](https://github.com/owfadev/owfa/blob/master/.meta/docs/distribution.md) — npm 通道:命令、工件、版本不变量、发布手册、安全姿态
92
+ - [.meta/docs/packages.md](https://github.com/owfadev/owfa/blob/master/.meta/docs/packages.md) — 包机制与设计理据:布局、PKG.yaml、不变量、版本、卸载契约、决策台账
93
+ - [.meta/docs/developer.md](https://github.com/owfadev/owfa/blob/master/.meta/docs/developer.md) — 开发者指南:插件落位三路径表、开发循环、注册与发现
94
+ - [.meta/docs/agents-example.md](https://github.com/owfadev/owfa/blob/master/.meta/docs/agents-example.md) / [.meta/docs/log-example.md](https://github.com/owfadev/owfa/blob/master/.meta/docs/log-example.md) — AGENTS.md 与 log.md 的实例种子(框架仓自身两者都不带)
95
+ - [.meta/docs/intro.md](https://github.com/owfadev/owfa/blob/master/.meta/docs/intro.md) — 导论:为什么是这个框架,叙事与谱系
96
+ - [.meta/docs/mechanics.md](https://github.com/owfadev/owfa/blob/master/.meta/docs/mechanics.md) — 机制:每个机制再深一层,附 bb 家族走查;动框架前先读
97
+ - [.meta/docs/usage.md](https://github.com/owfadev/owfa/blob/master/.meta/docs/usage.md) — 使用指南:三种工作循环(库务、课程学习、协作开发)
98
+ - [.meta/docs/quickstart.md](https://github.com/owfadev/owfa/blob/master/.meta/docs/quickstart.md) — 五分钟路径:一条命令或手动五步,然后首跑
99
+ - `.meta/protocol/` — 字段注册表、行动纪律、披露范式
100
+
101
+ ## 许可
102
+
103
+ MIT——见 [LICENSE](https://github.com/owfadev/owfa/blob/master/LICENSE)。