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,104 @@
1
+ ---
2
+ name: wiki_plugin_kernel
3
+ owner: framework
4
+ description: "Kernel and mechanics reference: the projector's subcommands (7 convergence — ls/validate/audit/inject/registry/deploy/all — plus 8 package-lifecycle: plan/install/uninstall/list-remote/migrate/upgrade/pkg/residual) + a full account of the plugin mechanics — manifest / dependencies / the three projections / command binding / bridge rules / layering principles (a bb-domain worked example). Triggers on: 插件内核, wiki_plugin_kernel, kernel, 注入块更新, 投影重建, 插件机制, 更新注入."
5
+ ---
6
+
7
+ # wiki_plugin_kernel: kernel and mechanics reference
8
+
9
+ `python .meta/scripts/wiki_plugin_kernel.py <subcommand>` — the framework side's only projector: PLUGIN.yaml is the body; the AGENTS.md injection region, the check check blocks, the command usage blocks, the registry plugin section, and the command and connector skill copies are all its projections. Idempotent, runnable at any time; drift is fixed on the run. This skill also serves as the **mechanics master outline**: a deployed instance carrying only the AGENTS.md injection region + skill copies is self-sufficient; this file is the authoritative home of the mechanics on the deployment side.
10
+
11
+ ## Subcommands
12
+
13
+ | Subcommand | Purpose | Disk writes |
14
+ |---|---|---|
15
+ | `ls` | plugin list + dependencies + driven commands | none |
16
+ | `validate` | compliance checks: manifest fields, acyclic dependencies, owner×commands bidirectional consistency, consumes present with usage, usage_routes targets present and not duplicating consumes, bridge rules; exit code 1 on error | none |
17
+ | `audit` | attached audit: executes each plugin's `scripts/check.py` on discovery, read-only report (may take a plugin id to check just one) | none |
18
+ | `inject` | rebuilds the three projections: the AGENTS injection region + the check check blocks + the command usage blocks | AGENTS.md, command SKILL.md files containing injection regions |
19
+ | `registry` | rebuilds the registry.yaml plugin section (from each manifest's `fields`) | registry.yaml |
20
+ | `deploy` | syncs skill masters (`.meta/command/*/` commands + `connectors/*/` connectors) → `.agents/skills/` copies; orphan copies are reported only (deletion belongs to the human) | copies |
21
+ | `all` | validate + inject + registry + deploy in one step | all of the above |
22
+
23
+ Package lifecycle (full wizard protocol and judgment rules: `.meta/command/plugin/SKILL.md`):
24
+
25
+ | Subcommand | Purpose | Disk writes |
26
+ |---|---|---|
27
+ | `plan <pkg>` | dependency plan for a package about to land | none |
28
+ | `install <pkg> [--yes] [--without ...]` | fetch from registry or path → `domains/<pkg>/`; owner/repo specs need `--yes` (unknown trust); stages pending migrations | package dir, projections, migrations staging |
29
+ | `uninstall <pkg> [--yes]` | remove package + projections; stages teardown (x->0) when declared | inverse of install |
30
+ | `list-remote` | registry catalog (INDEX.yaml): packages, versions, compat floors | none |
31
+ | `migrate [<pkg>] [--clear] [--force]` | pending semantic migrations: status / clear (verify- and residual-gated, use-and-delete) | migrations staging |
32
+ | `upgrade [<pkg>]` | compare versions against the registry; apply via silent reinstall | as install |
33
+ | `pkg` | installed packages: members, versions, connectors | none |
34
+ | `residual <pkg>` | anchor-surface reference scan (the default teardown gate) | none |
35
+
36
+ The kernel journal (`.meta/kernel-journal.log`, rolling cap of 500 lines, git-tracked) records the mechanical chain — install / warn+ / clear / uninstall / sweep; mechanical facts only, semantic narrative stays in the instance wiki's log.
37
+
38
+ ## Typical scenarios
39
+
40
+ - **PLUGIN.yaml changed** (inject / checks / usage / fields / version): `python .meta/scripts/wiki_plugin_kernel.py all` — the daily standard action; one command converges everything; if validate fails it blocks — fix and rerun
41
+ - **Only refreshing injection blocks**: `inject` suffices, but note it modifies the `.meta/command/` masters; copies sync only via `deploy` — hence always use `all` in daily work
42
+ - **Quick health check**: `validate` (structure) + `audit` (attached audit); a full audit (including semantic items) goes through the check command
43
+ - **(Un)installing plugins**: the semantic flow (decisions, directory archiving, log line) goes through the plugin command; the mechanical steps inside it are exactly this CLI's `validate` / `all` / `audit`
44
+ - **Connector skill changed** (`connectors/*/SKILL.md` master): run `deploy` (or `all`) to sync copies — connector skills never enter `.meta/command/` (the command family is pure wiki operation)
45
+
46
+ ## Plugin shape
47
+
48
+ - **One plugin, one directory** (`.meta/plugins/<id>/`): `PLUGIN.yaml` (the manifest, the machine-readable body) + `PLUGIN.md` (pure documentation: design summary (why / family position / key rulings and rejected alternatives) / Structure / Invariants / Changelog — **design rationale and per-plugin details belong here**; mechanics commonalities belong to this reference) + optional `scripts/check.py` (attached audit)
49
+ - **Manifest keys**: seven required keys `id / version / depends / updated / attachment / fields / inject`; optional `commands` (command names this plugin drives), `usage` (write-side contract list — the third projection source), `checks` (check-rule list — the check projection source), `bridge` (bridge declaration, see bridge rules), `inject_tier` (injection tier, see tier law below)
50
+ - **attachment** = declares territory and borrow-read relationships (who owns which paths, who read-only consumes whose pages); **fields** = owned page fields (enter the registry, the global vocabulary); **inject** = the plugin's disclosure, one line (the full-disclosure home in the manifest either way; known to the agent the moment it enters the repository when tier is full, read on demand when tier is member)
51
+ - **Attached-audit contract**: `scripts/check.py` defines `check(ctx)` returning `[{level, message}]`; read-only with zero side effects; fixes belong to commands/humans; an AST static check validates the contract's shape
52
+
53
+ ## Dependency mechanics
54
+
55
+ - `depends` declares behavioral or semantic dependencies (e.g. a bridging piece depends on the concept plugins on both ends); validate checks existence and acyclicity (DFS)
56
+ - **Domain plugins** = those whose depends chain reaches `domain`; those directly depending on domain are **domain bases** (vault / lark / project / email / bb). In-domain plugins belong to the domain transitively and need not connect to domain directly
57
+ - **Injection order = dependency topology (the depended-on injected first) + alphabetical within a batch** — consumer-side plugins are injected after the producers' disclosures are present (e.g. bb-track before bb-teach / bb-quiz); there is no layering concept
58
+ - A domain must be discoverable within the wiki (declaration page or injection line); domain plugins create no root container — course/in-domain artifacts live in the domain territory (both sides `<term>/<course>/` isomorphic), with the general-purpose container (vault) or pointers as the default posture
59
+
60
+ ## Tier law (issue #12 layer discipline)
61
+
62
+ - **`inject_tier: full | member`** (optional, default full): **full** projects into the AGENTS.md injection region; **member** exits it — exposure rides on the family root's roster line (every member named with id + one phrase), the skill catalog (trigger-surface awareness), and L-layer reads (the manifest `inject` field stays the full-disclosure home either way)
63
+ - Validate requires a member to reach a **full-tier domain root** through depends (family membership, else it exits into invisibility)
64
+ - The projected plugin blocks carry a **byte budget** (15 KiB, derived from the smallest mainstream whole-file AGENTS.md cap minus handwritten allowance): over-budget is a validate error — compress pointer lines or re-tier domain members; the A layer holds pointers and red lines only, never procedures or formats (content contract in `protocol/experiments.md`)
65
+
66
+ ## Command-plugin binding
67
+
68
+ - **owner × commands bidirectional declaration**: the command SKILL.md frontmatter `owner: <plugin id>` (or `framework`, explicitly ownerless), the plugin manifest `commands: [command name]`; a one-sided declaration on either side is an error
69
+ - **consumes (pull side)**: the command frontmatter `consumes: [plugin list]` — the destination declares which plugins' usage to pull; mandatory for owner-driven commands and must include all owners
70
+ - **usage_routes (source-side routing)**: the plugin manifest `usage_routes: [command name list]` — additional commands the usage lands in; installing a plugin lands its projections without touching the destination command (the push side of "presence means registration"); validate checks that targets are present, that routed plugins carry usage, and that duplication with consumes is an error
71
+ - **Disclosure order**: owner blocks first (consumes order), routed blocks in the middle (dependency topology plus alphabetical), the rest of consumes last — this is a presentation order, not an execution order
72
+ - First case: bb-teach and bb-quiz each declare `usage_routes: [bb-track]` — the cognition hub automatically aggregates the collection channels' usage; the bb-track command's consumes keeps only its own and tools; `ls` prints the usage routing table (those without a landing point are marked as contract-document surfaces)
73
+ - The **disclosure at the point of consumption** principle: the authoritative source of integration formats is usage (reaching commands via projection), not plugin prose — see the last item of the bridge rules
74
+
75
+ ## Projection mechanics (three projections, one source)
76
+
77
+ - **The manifest is the only text source**; the kernel mechanically projects into three places, all idempotently rebuilt and auto-synced on (un)install:
78
+ 1. **The AGENTS.md injection region** (`wiki-inject:start/end` marker blocks) ← the `inject` line — constitutional level, one block per full-tier plugin (member tier exits, see the tier law)
79
+ 2. **The check check blocks** (`check-inject:start/end` inside the check command) ← the `checks` list — semantic-item check rules
80
+ 3. **The command usage blocks** (`cmd-inject:start/end` inside each command) ← the `usage` list in consumes order — write-side contracts
81
+ - A fourth mechanical projection: the **registry.yaml plugin section** ← `fields` (the global field vocabulary); a fifth: the **skill copies** (deploy)
82
+ - Handwritten and mechanical regions are strictly separated: hand-editing inside marker blocks is forbidden (a rebuild overwrites); body text outside blocks belongs to humans; changing a contract = edit the manifest → converge with `all` — **there is no second source of truth**
83
+
84
+ ## Bridge rules (constitutional principle 11)
85
+
86
+ - **Global plugins** (cross-cutting services and destinations: trust / log / todo / calendar / notes / user-profile…) may declare **bridges** — manifest `bridge: 必依|按需` (must-attach|on-demand); **domain plugins** may not hold bridges (any plugin whose depends chain reaches domain — holding one is an error)
87
+ - **必依 (must-attach) bridges**: every domain base must carry the corresponding depends edge; a missing edge is an error (the topological-completeness invariant — e.g. the log must-attach bridge guarantees that anything a domain produces leaves a trace); **按需 (on-demand) bridges**: absence is tolerated (consumers skip without error, e.g. the user-profile cognition bridge)
88
+ - **Division of labor between bridges and cmd-inject** (ruled 2026-10-04): bridges hold **validation and declaration** (who may attach, cardinality, completeness checks, absence tolerance); disclosure distribution belongs to projection (the authoritative source of integration-format details = usage, arriving at the point of consumption via cmd-inject, zero retrieval cost) — the bridge section (PLUGIN.md) recedes into elaboration and holds no format authority. The kernel of a bridge that cmd-inject cannot replace: the must-attach completeness check is a topological constraint that consumes cannot express; and cross-territory writes (todo/calendar/notes derivations) happen during every command execution, with no single-point command container to mount them in
89
+
90
+ ## Layering principles (in-domain example: the bb four-piece family)
91
+
92
+ - **The material layer is in bb/ (the outer workspace), the archive layer in wiki/ (the inner territory)**: process artifacts (fetches, human notes, ai notes, exam grading) live in the material layer; settled conclusions (cognition readings, projection pages) live in the archive layer — "bb/ notes/: human-primary with ai cohabiting" and "user.md as a domain-native page" are instances of this layering
93
+ - A domain's growth path: **the domain contract's six questions** (external territory / landing strategy / identity proof / wiki territory / write model / trust model) → the domain base establishes the territory (e.g. bb v0.7: both sides isomorphic + notes/ cohabitation) → the in-domain plugin family (bb-map projection rules, bb-track cognition profile) → consumer-side collection channels (bb-teach / bb-quiz: zero-territory workflow pieces whose usage mounts on the hub command via consumes) — **consumer-side plugins can take the thinnest form** (zero owned fields, contributing only usage and check rules)
94
+ - A data-flow loop example: teach explains → ai notes land in notes/ (weak evidence) → track consumes and converges → quiz generates questions with reference → grading flows back into the evidence stream (machine evidence) — the three stages of material production, archive refinement, and collection write-back each belong to their own piece
95
+
96
+ ## Boundaries
97
+
98
+ - The script touches only four sites: plugin directories in/out, injection-region marker blocks, the registry plugin section, and the skill deployment copies; the protocol / reserved sections and the AGENTS.md handwritten region are never touched
99
+ - Pure standard library, zero dependencies (Python 3); English output
100
+ - The data-zone derived layer (`wiki/index.md`, `tags.md`, `hot.md`, `log.md`) is not this CLI's business — that is `pipeline.py` (`index` / `tags` / `hot` / `log` / `verify`), invoked by the post-write pipelines of map / save
101
+
102
+ ## Parameters
103
+
104
+ - Subcommand (see the table above); `audit` may take a plugin id
package/.meta/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.3.1
@@ -0,0 +1,39 @@
1
+ ---
2
+ name: asset-read
3
+ owner: framework
4
+ description: "Extract text from assets of any format by path (md read directly / pdf via PyMuPDF / docx and xlsx unpacked with the standard library); outputs are cached in wiki/tmp and marked with stale_after — the unified channel and caching convention for source-origin reads. Triggers on: asset-read, 读资产, 回源, 提取文本, 读课件原文, read asset."
5
+ ---
6
+
7
+ # asset-read: source-origin asset reading
8
+
9
+ Read the text of assets of any format by path — the unified channel for source-origin reads: vault assets, bb/ fetched artifacts, and relative paths outside the repository are all eligible. Reading augments registration rather than replacing it: the proxy page's one-line description covers the overview; only a deep question goes back to the source.
10
+
11
+ ## Scope
12
+
13
+ Read: assets of any format (file system outside wiki, read-only)
14
+ Write: `wiki/tmp/` extraction cache (the only landing spot)
15
+
16
+ ## Steps
17
+
18
+ 1. Locate the asset path and extension; md / txt / csv are read directly and done — no cache is written
19
+ 2. Check the cache: if `wiki/tmp/<asset name>.txt` is present and not past stale_after → read the cache directly, do not re-extract
20
+ 3. On a miss, extract:
21
+ - pdf: PyMuPDF (`import fitz`; if missing, install it per the host's Python package manager — e.g. pip on dev desktops, uv on PEP 668 hosts; instance-level environment declarations in AGENTS.md take precedence); for large files, extract by page range or keyword location — never feed the whole book into context
22
+ - docx / xlsx: pure standard-library zipfile + xml text-node extraction
23
+ - other binaries: no deep read; report honestly "text extraction not supported"
24
+ 4. Write the output to `wiki/tmp/<asset name>.txt`, with a three-line comment header: source path / extraction date / stale_after = extraction date + 7 days
25
+ 5. Report key points with provenance (page number or section name)
26
+
27
+ ## Prohibitions
28
+
29
+ - Never modify asset originals (the read-only discipline holds in whatever domain they live)
30
+ - No bulk full extraction — single items on demand; one-off views are not cached
31
+ - Cache expiry is reported as a list by check, and disposal requires confirmation (an existing rule of the tmp plugin; this command does not clean up on its own)
32
+
33
+ ## Language
34
+
35
+ Output language takes the default key of the language declaration page `wiki/language.md` (a missing page or missing key falls back to the session language); asset originals keep their original language and form.
36
+
37
+ ## Parameters
38
+
39
+ - Asset path (root-relative); optional page range or locating keyword
@@ -0,0 +1,130 @@
1
+ ---
2
+ name: check
3
+ owner: framework
4
+ description: "Audit the repository's health: hard-structure checks on the foundation and plugins + semantic checks on plugins and pages. Triggers on: check, 健康检查, 检查插件, lint."
5
+ ---
6
+
7
+ # check: repository health audit
8
+
9
+ This is an audit, not a guardrail. It outputs a graded report: error = structural breakage requiring action; warning = a suggested to-do. Check rules come from two places: the foundation part of this file (protocol level) + the injection region below (a mechanical projection by wiki_plugin_kernel from each plugin manifest's checks list; presence means registration).
10
+
11
+ ## Purpose
12
+
13
+ Run one health audit over the entire instance (foundation + plugins + wiki pages).
14
+
15
+ ## Scope
16
+
17
+ Read: everything (.meta/, the AGENTS.md injection region, .agents/skills/, the wiki/, vault/ directory trees)
18
+ Write: one line in wiki/log.md (type "check"); regenerable zones are rebuilt directly per the action discipline (scripts: injection region / registry / command copies; semantics: index / tags / hot eviction / log archiving / hash recomputation)
19
+
20
+ ## Steps
21
+
22
+ 1. **Foundation hard checks** (protocol level):
23
+ - **Static self-check script**: `python .meta/scripts/wiki_plugin_kernel.py validate` (directory completeness, manifest seven fields + optional commands, id consistency, dependency existence, acyclicity, command binding owner×commands bidirectional consistency) — any error means FAIL
24
+ - **Idempotent rebuild**: `python .meta/scripts/wiki_plugin_kernel.py all` (injection region / registry plugin section / command copies — mechanical and automatic; drift is fixed here, the script source is the rule list)
25
+ - `.meta/protocol/registry.yaml` is in place with the protocol / reserved sections intact (the script never touches these two sections; a missing section is an error)
26
+ - **Value-set violation**: scan the frontmatter of all wiki/ pages; a type / status value outside the registry value set → error
27
+ - Every `.meta/command/` SKILL.md has frontmatter (name / description / owner; optional consumes — an ordered list of plugins whose write-side contracts are consumed; referenced plugins must be present with a usage list; mandatory for owner-driven commands)
28
+ 2. **Plugin checks**: first run the attached audit `python .meta/scripts/wiki_plugin_kernel.py audit` (mechanical items: each plugin's scripts/check.py executed on audit discovery, read-only reporting; errors count toward FAIL); then execute the items marked "semantic" in the injection-region blocks below
29
+ 3. **Semantic checks**: read plugin and command files, looking for dangling references (a command referring to nonexistent structure), ghost fields (page fields with no owning plugin and not registry-reserved), and injection-region blocks inconsistent with the PLUGIN.md Checks section
30
+ 4. Summary output: PASS / WARN / FAIL counts + graded details + vault backlog count (informational)
31
+ 5. **Fixes are executed by grade per the action discipline** (`.meta/protocol/actions.md`): mechanical-automatic items are done directly — `pipeline.py index` / `tags` (index rebuild), `wiki_plugin_kernel.py all` (registry / injection region / copies), hash recomputation (raw_sha256 of changed frontmatter); hot / log overflows are converged by their own write-pipeline commands; mechanical-confirmation items present a list and ask once; semantic items are reported only; historical entries are never automatically changed
32
+ 6. Prepend one line to wiki/log.md (type "check", via `pipeline.py log check "<one line>"`); if anything changed (fixes / a log line), commit per the commit discipline (`检查: <conclusion>`, see `.meta/protocol/actions.md`)
33
+
34
+ ## Tools
35
+
36
+ grep / file reading suffice; no second scan when one read is enough (call frugality).
37
+
38
+ ## Parameters
39
+
40
+ - None: full-repository audit
41
+ - Plugin id: check that plugin only
42
+
43
+ ## Injected Section (plugin check blocks)
44
+
45
+ > This region is a wiki_plugin_kernel projection from each plugin manifest's checks list (rebuilt by `inject` / `all`; presence means registration); handwritten content does not belong here — to change check rules, edit PLUGIN.yaml.
46
+
47
+ <!-- check-inject:start -->
48
+ <!-- check:device -->
49
+ - Mechanical (attached-audit script `scripts/check.py`, executed discovery-style by audit): device block mapping's warranty_until within ≤30 days of today → warning nearing expiry; already expired → warning expired; invalid date → warning
50
+ <!-- /check:device -->
51
+
52
+ <!-- check:hot -->
53
+ - Window out of bounds (>25 entries / >5 days / >200 chars per entry) → run `pipeline.py hot <type> "<backfill>"` once, or wait for the next write to converge naturally then re-check
54
+ - Contradiction with log (log has records while hot shows no trace) → warning
55
+ <!-- /check:hot -->
56
+
57
+ <!-- check:language -->
58
+ - Mechanical (attached-audit script `scripts/check.py`, executed discovery-style by audit): type: language landing outside `wiki/language.md` → error; terms empty values → warning; declaration page absent → info (session-language fallback tolerated)
59
+ <!-- /check:language -->
60
+
61
+ <!-- check:link -->
62
+ - Mechanical items (attached-audit script `scripts/check.py`, executed on audit discovery): broken link (target is neither a page full name nor any page's aliases) → warning; hand-written broken link in hot → warning (not counted as an inbound-link source); garbled link (target contains the U+FFFD replacement character, including related items) → error; alias ambiguity (two pages declaring the same aliases, resolution indeterminate) → error; orphan page (no inbound links and no related references, inbound sources counting concept pages only) → warning for notes knowledge pages, info for territory-value registration pages (registry territory values except session, having no inbound links yet being the registration norm); one-way related (A lists B while B does not list back) → info
63
+ - Semantic items (check command): inbound-link density top list → info item (evidence for hub emergence, no alert)
64
+ <!-- /check:link -->
65
+
66
+ <!-- check:log -->
67
+ - Mechanical items (attached-audit script `scripts/check.py`, executed on audit discovery): undated entries (starting with `- ` yet not matching the date format, main file and archive checked alike) → error
68
+ - Semantic items (check command): historical entries modified (verifiable via git) → error; capacity over the limit → re-check after mechanical archiving
69
+ <!-- /check:log -->
70
+
71
+ <!-- check:notes -->
72
+ - Traces of a note overwritten by a command → error
73
+ - Near-duplicate notes (Jaccard > 0.7) → warning
74
+ <!-- /check:notes -->
75
+
76
+ <!-- check:sessions -->
77
+ - Mechanical (covered by audit): session-type pages outside `wiki/sessions/` (or the reverse) → warning; participants missing or entries violating the actor convention → warning
78
+ - Semantic: backbone page bloated past due promotion (should have been promoted but was not) → warning
79
+ <!-- /check:sessions -->
80
+
81
+ <!-- check:tag -->
82
+ - Mechanical items (attached-audit script `scripts/check.py`, executed on audit discovery): >5 tags on one page → warning; tags restating type → warning; hierarchy over the limit (parent/child ≤2) or empty segment → warning
83
+ - Semantic items (check command): near-duplicate tags → warning suggesting a merge; merging is a mechanically-confirmed item (list presented, executed after user confirmation)
84
+ <!-- /check:tag -->
85
+
86
+ <!-- check:tmp -->
87
+ - Semantic (v0.1 manual, attached audit deferred): type: tmp landing outside wiki/tmp/ → error; stale_after already past → warning (cleanup prompt); tmp page count > 20 → info (backlog triage)
88
+ <!-- /check:tmp -->
89
+
90
+ <!-- check:trust -->
91
+ - Mechanical items (attached-audit script `scripts/check.py`, executed on audit discovery): generated missing by/at or wrong actor format, verified event missing by/at or wrong format, stale_after not YYYY-MM-DD, sources not a list → warning
92
+ - Mechanical items (info level): stale page list (past stale_after); trust-level counts (human-reviewed / machine-confirmed counts)
93
+ - Semantic (check command): stale-page disposition triage (refresh the moment / re-verify / deprecate) — human decides
94
+ <!-- /check:trust -->
95
+
96
+ <!-- check:calendar -->
97
+ - Semantic (v0.1 manual, attached audit deferred): month page file name not YYYY-MM or landing outside wiki/calendar/ → error; traces of rewriting a past month's page → error (git audit); declaration page missing the `calendar` block → info (the manual-only norm)
98
+ <!-- /check:calendar -->
99
+
100
+ <!-- check:cron -->
101
+ - Mechanical: a type: cron page landing outside wiki/cron/ → error; task page missing the cron block or the minimal key set (trigger/action/form/status) → warning; malformed condition trigger (kind outside the open vocabulary or missing target) → warning; time form: last_run beyond the schedule period with active → warning (projection-lost signal)
102
+ - Semantic (attached audit deferred): per-form drift between readable execution-side lists (scheduler / system tasks / conditional-executor watches, best-effort) and the declaration page set → warning; unreadable executor → info
103
+ <!-- /check:cron -->
104
+
105
+ <!-- check:index -->
106
+ - Deviation between indexes and the actual page set (including merged-back indexes pending deletion) → fixed by running `pipeline.py index` to rebuild (idempotent; no diff means consistent); same for tags (`pipeline.py tags`)
107
+ - Traces of hand editing → warning
108
+ <!-- /check:index -->
109
+
110
+ <!-- check:todo -->
111
+ - Mechanical (info-level): the list of date-triggered, overdue and unsettled entries (the mechanical basis for new-session reminders); page absent (the no-delegation norm)
112
+ - Mechanical: entry missing trigger condition or by/at → warning; type: todo landing outside `wiki/todo.md` → error
113
+ - Semantic (check command): open entries > 50 → warning (bloat triage: do what should be done, distill what should be distilled via save, confirm with the user what should be dropped)
114
+ <!-- /check:todo -->
115
+
116
+ <!-- check:user-profile -->
117
+ - Semantic (check command): profile assertion missing an evidence wikilink → warning
118
+ - Mechanical: a type: profile page landing in `wiki/notes/` or `wiki/vault/` (wrong territory) → error
119
+ - Mechanical (info-level): profile page absent (the untriggered norm; profile self-creates on first trigger)
120
+ <!-- /check:user-profile -->
121
+
122
+ <!-- check:mapping -->
123
+ - Mechanical items (attached-audit script `scripts/check.py`, executed on audit discovery): mirror diff (file in vault without proxy → info backlog; proxy without counterpart → error, message carries the reference count — see the impact surface before deleting); missing registration fields (raw_file / raw_sha256) → error; dangling raw_file → error; raw_sha256 mismatch → warning; suspected full-text duplication (md asset body ≥80% of the original) → warning; description-less stub with updated older than 90 days → warning
124
+ - Semantic items (check command): mismatch-disposition triage (description still applies → mechanical recalculation auto-repairs, writing a log line on completion (type map, one sentence with the asset name and 'original changed, description still applies'); suspected invalid → human decides remap or delete); diary-type full-text duplication exemption judgment; before disposing an orphan proxy, handle its references first (update references in sync or leave aliases to redirect)
125
+ <!-- /check:mapping -->
126
+
127
+ <!-- check:structure -->
128
+ - Mechanical items (attached-audit script `scripts/check.py`, executed on audit discovery): declaration diff — vault top-level directory undeclared → warning, declaration key pointing to a nonexistent directory → warning; type: structure landing outside `wiki/structure.md` → error; declaration page absent → info (flat tolerance)
129
+ <!-- /check:structure -->
130
+ <!-- check-inject:end -->
@@ -0,0 +1,24 @@
1
+ ---
2
+ name: docs
3
+ owner: framework
4
+ description: "Docs thin-router: points to the documentation map and the behavior/feedback protocol — no norms live in this skill. Fire when the user reports dissatisfaction with agent behavior (possible plugin/kernel cause), asks where something is documented, or how to file feedback. Triggers on: docs, 查文档, 文档在哪, 框架问题, 行为自检, agent-behavior, 怎么提issue."
5
+ ---
6
+
7
+ # docs: thin router to the documentation layer
8
+
9
+ S-layer pointer only — the norms live in the documents (L layer). Re-read what you cite; never quote from memory.
10
+
11
+ ## 1. User dissatisfaction → triage first, consent before any self-audit
12
+
13
+ When the user reports dissatisfaction with your behavior, do **not** launch an analysis on your own:
14
+
15
+ - **Not a plugin/kernel matter** (pure conversation, execution slip)? Ignore the rest of this skill — respond to the user directly, fix in-session.
16
+ - **Possibly a plugin or kernel problem?** First ask the user whether to run a behavior self-audit (**recommended** — it produces the evidence base for a real fix). Only on consent, follow the protocol: [`.meta/docs/agent-behavior.md`](../../docs/agent-behavior.md) — feedback handling → routing → the seven-step standard.
17
+
18
+ ## 2. "Where is X documented?" / "how does X work?"
19
+
20
+ Read [`.meta/docs/map.md`](../../docs/map.md) — the routing table (what to read when), framework docs and package-repo docs both.
21
+
22
+ ## 3. Filing feedback / issues
23
+
24
+ The routing table lives in [`.meta/docs/agent-behavior.md`](../../docs/agent-behavior.md) §Routing: framework → owfa; package members → the matching `pkg-*` repo; new-plugin proposals → incubation on owfa.
@@ -0,0 +1,72 @@
1
+ ---
2
+ name: map
3
+ owner: mapping
4
+ consumes: [mapping, trust, tag, index, hot, log]
5
+ description: "Map assets in vault/ into wiki proxy pages: SHA-256, mirror path, frontmatter, index/hot-cache/log linkage. Triggers on: map, 映射, process this source, add this to the wiki."
6
+ ---
7
+
8
+ # map: mapping
9
+
10
+ Map assets in `vault/` into `wiki/vault/` proxy pages — mapping and understanding are decoupled: a pure registration action (registration fields, body scale, and other write-side contracts are in the injection region). It targets only assets already in vault and does no vault-side processing (organizing and polishing belong to vault governance, discussed separately).
11
+
12
+ ## Scope
13
+
14
+ Write: mapping (proxy pages), log, hot, index
15
+ Read: registry (`.meta/protocol/registry.yaml`, field and value-set anchor), tag (vocabulary `wiki/tags.md`), trust (generated), vault (originals)
16
+
17
+ ## Steps
18
+
19
+ 1. **Anchor (one-time read)**: read `.meta/protocol/registry.yaml` and `wiki/tags.md` — value sets and the existing vocabulary are visible before writing
20
+ 2. Read the target asset in vault/
21
+ 3. Assemble the proxy-page draft per the write-side contracts in the injection region (mapping mirror and registration fields, trust generated, tag labeling); **present the mapping preview** (path / hash / description / tags) and wait for user confirmation
22
+ 4. After confirmation, write the proxy page
23
+ 5. **Post-write pipeline** (deterministic, mechanical and automatic, no prompting): execute each plugin's write calls in injection-region order, then finish with `python .meta/scripts/pipeline.py verify` (post-write self-verification; on failure, go back and fix); then commit per the commit discipline (`映射: <asset name>`, see the vocabulary in `.meta/protocol/actions.md`)
24
+ 6. Report: path / hash / description / tags
25
+
26
+ ## Prohibitions
27
+
28
+ - Never modify any vault/ file (the command side is append-only toward vault); other hard rules (hash always computed, body never a full copy, etc.) defer to the mapping block of the injection region
29
+
30
+ ## Language
31
+
32
+ Output language takes the default key of the language declaration page `wiki/language.md` (a missing page or missing key falls back to the session language); proper nouns and paths keep their original form.
33
+
34
+ ## Parameters
35
+
36
+ - Asset path (relative inside vault/); batching allowed
37
+
38
+ ## Injected Section (plugin usage blocks)
39
+
40
+ > This region is a wiki_plugin_kernel projection: consumes pulls merged with usage_routes source-side routing; disclosure order = owner first, routed blocks in the middle, pulled blocks last (rebuilt by inject / all); handwritten content does not belong here — to change the write-side contract, edit PLUGIN.yaml.
41
+
42
+ <!-- cmd-inject:start -->
43
+ <!-- usage:mapping -->
44
+ - Mirror locating: proxy path = `wiki/vault/<original-path>.md` (original name + .md, prevents name collisions); md assets also get proxies, no exceptions
45
+ - Registration fields: `type: source` + `raw_file` (root-relative path) / `raw_sha256` (hexadecimal SHA-256, never skip the computation)
46
+ - Body starts with a one-line description, never copying the full original text; summary / structure extraction are optional enhancements; diary-type assets are registration-first, summaries not enforced
47
+ - URL-type assets: the proxy page carries `url` (vault field — source link, source preservation; required when placed via agent channels, optional for manual placement)
48
+ <!-- /usage:mapping -->
49
+
50
+ <!-- usage:trust -->
51
+ - When writing a page, write `generated` along the way (block style: `by: agent/<current-model>` / `at: <today>`)
52
+ - When a review action happens, append a `verified` event (single line `by: <actor>, at: <date>`), never fabricated to inflate the level
53
+ - Reviews are initiated by the user (triggered by human instruction); agents never append verified events on their own
54
+ <!-- /usage:trust -->
55
+
56
+ <!-- usage:tag -->
57
+ - Before writing, read `wiki/tags.md` and prefer reusing existing terms
58
+ - New-term conventions: primary language follows the language page's default key (absent → session language, preventing mixed Chinese-English fragmentation of the vocabulary); English lowercase kebab-case; hierarchy ≤2; ≤5 per page; restating type forbidden
59
+ <!-- /usage:tag -->
60
+
61
+ <!-- usage:index -->
62
+ - Post-write rebuild (mechanical, automatic): `python .meta/scripts/pipeline.py index` (index — overflow-offloading scheme, including deletion of obsolete old indexes after merge-back) and the same script's `tags` (tag reverse index); LLMs never hand-write indexes
63
+ <!-- /usage:index -->
64
+
65
+ <!-- usage:hot -->
66
+ - Writing entries (mechanical, automatic): `python .meta/scripts/pipeline.py hot <type> "<wikilink + one-sentence essence>"` (type value set same as log, see the log block of the AGENTS injection region); window eviction and truncation are performed by the script
67
+ <!-- /usage:hot -->
68
+
69
+ <!-- usage:log -->
70
+ - Writing lines (mechanical, automatic): `python .meta/scripts/pipeline.py log <type> "<one sentence>" [--domain <domain>]` (type value set in the log block of the AGENTS injection region; domain tag = domain-plugin name such as bb/lark/vault, mandatory for in-domain transactions, omitted for framework and native transactions); rolling window and archiving are performed by the script
71
+ <!-- /usage:log -->
72
+ <!-- cmd-inject:end -->
@@ -0,0 +1,74 @@
1
+ ---
2
+ name: plugin
3
+ owner: framework
4
+ description: "Package & plugin lifecycle management: plan (disclosure wizard), install (three channels + --without subsets), uninstall, list-remote, upgrade, pkg, residual. Mechanical steps all go through .meta/scripts/wiki_plugin_kernel.py; the agent runs the consent conversation and the one-shot commands. Triggers on: plugin, 插件, 装插件, 卸插件, 装包, install package, uninstall package."
5
+ ---
6
+
7
+ # plugin: package lifecycle
8
+
9
+ The framework's self-management command, package era (issue #20). Every mechanical step goes through the kernel script; the agent's job is **consent and choice** — never writing `.meta/` by hand.
10
+
11
+ ## Scope
12
+
13
+ Write: only via the kernel script (package masters in/out, connectors/, command masters, injection region, registry, skill copies — six sites)
14
+ Read: INDEX via the kernel, PKG.yaml, manifests
15
+
16
+ ## Discovery → download: the consent wizard (human path)
17
+
18
+ When a user asks to install a package and has NOT already specified what to include:
19
+
20
+ 1. `python .meta/scripts/wiki_plugin_kernel.py plan <pkg>` — one-shot disclosure plan: trust line, package disclosure (network/privacy/credentials, package-authored), baseline (the family root, always installed), optional members with one-line summaries and what each selection pulls in, connectors
21
+ 2. Relay the plan **in the user's language** (render at the agent layer per wiki/language.md — canonical texts are English; the agent translates when relaying, never edits the source)
22
+ 3. Walk the steps: trust + disclosure → user acknowledges; optional members → user picks (each pick auto-pulls its dependency closure — show the resolved final set, users cannot compose an illegal subset); connectors → confirm (they ride the package)
23
+ 4. Execute: `python .meta/scripts/wiki_plugin_kernel.py install <pkg> --without <unwanted> [--yes]`
24
+ 5. Report the convergence output (validate/inject/registry/deploy) in one breath
25
+
26
+ ## One-shot path (agent / pre-authorized)
27
+
28
+ If consent already exists (user named exactly what they want, or pre-authorized), skip the conversation:
29
+
30
+ ```
31
+ python .meta/scripts/wiki_plugin_kernel.py plan <pkg> --json # machine-readable plan (optional)
32
+ python .meta/scripts/wiki_plugin_kernel.py install <pkg> [--without a,b] [--yes]
33
+ ```
34
+
35
+ Kernel commands never prompt — every invocation completes in one shot.
36
+
37
+ ## Transaction close: git snapshot
38
+
39
+ Every package transaction (install / uninstall / upgrade apply / migrate clear) ends with **one git commit at close** — after validate goes green, mechanical + semantic changes in the same snapshot. The kernel itself never touches git (the journal is its ledger); committing is the agent's closing move. Message format `plugin: <verb> <pkg> [v<version>]` per the [instance-git plugin](../../plugins/core/instance-git/PLUGIN.md). Not a git repo? Skip silently.
40
+
41
+ ## Command surface
42
+
43
+ | Command | What it does |
44
+ |---|---|
45
+ | `plan <pkg> [--json] [--without a,b]` | disclosure plan (+ subset preview); clone discarded, nothing installed |
46
+ | `install <pkg>[@tag]` | registry path: trust gate → clone → verify (id/compat/members ↔ index) → place masters/connectors/commands → converge |
47
+ | `install <owner/repo> --yes` | unindexed direct install (trust: unknown — the registry PR is how a package earns reviewed trust) |
48
+ | `install <pkg> --path <dir>` | local package (developer loop, channel C) |
49
+ | `install ... --without a,b` | D5 subset: named leaves + their dependents pruned; root never prunable; result is dependency-closed by construction |
50
+ | `uninstall <pkg> --yes` | D6 four-clear + convergence + residual scan + retains/credentials reminders; data zones and credentials never touched |
51
+ | `list-remote` | registry index with members and trust marks |
52
+ | `upgrade` | reconciliation report; upgrades run uninstall+install per package, never cascaded |
53
+ | `upgrade <pkg> --yes` | mechanical reinstall + update report (member deltas + changelog excerpts) + migration chain staging |
54
+ | `migrate <pkg>` / `--clear` | pending status + declaration printing / verify-gated clear (deletes staged files, unblesses validate) |
55
+ | `pkg` / `ls` / `residual <pkg>` | local inventory / plugin list / anchor-surface reference scan |
56
+
57
+ ## Semantic migrations (update path)
58
+
59
+ Mechanical sync is only half an update. When a new version carries `migrations/`:
60
+
61
+ 1. The kernel stages declarations into `.meta/migrations/<pkg>/` (kernel zone — never inside the package dir), registers the warning ledger, and raises the **tri-face warning**: every kernel invocation prints the pending banner · `validate` stays red (mechanical blessing withheld) · a kernel-managed block lands in the AGENTS injection region so every session sees it
62
+ 2. `kernel migrate <pkg>` prints the staged declarations (init or version-chain) — relay them in the user's language
63
+ 3. Perform the semantic transformation via the normal command surfaces (confirmation gates as always); **judgment split rule**: assertions that hold only during the transition belong in the author's verify script (dies with the migration); assertions that hold forever belong in `scripts/check.py` (same release)
64
+ 4. **Subset matching**: declarations and verifies address the **installed subset**, never the full roster — steps marked `(member: X)` run only when X is installed; verify scripts guard member-specific assertions with `ctx.installed` (the kernel passes it); the ledger records the staging-time subset
65
+ 5. `kernel migrate <pkg> --clear` runs the author verify (AST-gated: read-only, stdlib-adjacent, must define verify(ctx)) — clean clears the warning and **deletes the staged files (use-and-delete: they are useful precisely once; keeping them would blur into check's role)**
66
+ 6. The kernel journal (`.meta/kernel-journal.log`) records install/uninstall/upgrade/warn/clear with a rolling cap of 500 lines (oldest trimmed); it is git-tracked — mechanical facts only; semantic narrative stays in wiki/log
67
+
68
+ ## Boundaries
69
+
70
+ - **Consent is the agent's duty**: no install without user acknowledgment of the disclosure (unless pre-authorized); `--yes` gates exist precisely so consent is explicit
71
+ - **Trust is earned in the registry**: unindexed = installable but flagged unknown; the one-line registry PR is the review gate (inject text and connectors are the security faces)
72
+ - The script touches only its six mechanical sites; data zones (`wiki/`, `vault/`, `cuhksz/`, `projects/`), credentials (`~/*-cli`), and the AGENTS.md handwritten region are never touched
73
+ - Errors from the script always block; warnings are reported only
74
+ - Uninstall leaves data in place (deprecated posture); physical deletion belongs to the human
@@ -0,0 +1,75 @@
1
+ ---
2
+ name: profile
3
+ owner: user-profile
4
+ consumes: [user-profile, trust, index, hot, log]
5
+ description: "Maintain the user profile wiki/profile.md: recognize self-description and behavioral signals, update assertions convergently (new values replace old, changes leave traces in the body, evidence wikilinks); construction and consolidation go through a whole-page rewrite preview. Triggers on: profile, 更新画像, 画像更新, update profile."
6
+ ---
7
+
8
+ # profile: profile update
9
+
10
+ Write the continuing cognition about the user into a checkable page: assertions carry evidence, preferences expire, updates leave traces. The direction is "inner → user cognition" — orthogonal to map (outer → inner translation) and save (sessions landing on disk); convergent across sessions, not a transactional one-shot. Write-side contracts (signal criteria, layered placement, assertion format, convergence traces) are in the injection region.
11
+
12
+ ## Scope
13
+
14
+ Write: user-profile (wiki/profile.md), log, hot, index
15
+ Read: registry (`.meta/protocol/registry.yaml`, field and value-set anchor), trust (generated / stale_after), the current profile page (may be absent)
16
+
17
+ ## Steps
18
+
19
+ 1. **Anchor (one-time read)**: read `.meta/protocol/registry.yaml` and `wiki/profile.md` — a missing page = first creation (construction), no reliance on an initialization mechanism
20
+ 2. **Judge signals** (criteria in the injection region): if this session's and recent observations do not qualify, report and exit — never force a write
21
+ 3. Assemble the update: incremental assertions (new value replaces old + body trace) or construction / consolidation (whole-page rewrite) — construction and consolidation **present a profile preview** (assertions / evidence / layers) and wait for user confirmation
22
+ 4. Write the page (layered placement and stale_after renewal in the injection region)
23
+ 5. **Post-write pipeline** (deterministic, mechanical and automatic, no prompting): execute each plugin's write calls in injection-region order, then finish with `python .meta/scripts/pipeline.py verify` (post-write self-verification; on failure, go back and fix); then commit per the commit discipline (`画像: <one line>`, see the vocabulary in `.meta/protocol/actions.md`)
24
+ 6. Report: what was updated / the evidence chain / which layer it landed in
25
+
26
+ ## Prohibitions
27
+
28
+ - Privacy red line: profile content is instance data, never entering the framework repository or test-repo
29
+ - Diary-type assets contribute only meta-signals (presence, cadence); their content never enters the profile
30
+ - Evidence pages (session pages / vault proxy pages / lark archive pages) are referenced read-only, never rewritten
31
+
32
+ ## Language
33
+
34
+ Output language takes the default key of the language declaration page `wiki/language.md` (a missing page or missing key falls back to the session language); proper nouns and paths keep their original form.
35
+
36
+ ## Parameters
37
+
38
+ - No argument: judge recent signals and update; `<topic>`: process only that topic's assertions
39
+
40
+ ## Injected Section (plugin usage blocks)
41
+
42
+ > This region is a wiki_plugin_kernel projection: consumes pulls merged with usage_routes source-side routing; disclosure order = owner first, routed blocks in the middle, pulled blocks last (rebuilt by inject / all); handwritten content does not belong here — to change the write-side contract, edit PLUGIN.yaml.
43
+
44
+ <!-- cmd-inject:start -->
45
+ <!-- usage:user-profile -->
46
+ - Dual-track triggering: the user explicitly invokes profile; the agent calls it spontaneously in any session upon recognizing significant signals — signal distillation uniformly goes through this command, not parasitic on other command flows
47
+ - Signal criteria: self-reported signals (preference expressions, corrections, background) and behavioral signals (subjects, fields, material habits); record only recurring subjects/fields, explicit preference expressions, corrections to output, and stable background facts (identity/tools/environment); one-off and instrumental content and uncertain observations are not recorded
48
+ - Evidence domain: any page inside wiki works (session pages, vault proxy pages, lark archive pages, notes) — a citation is a wikilink, no cross-domain dependencies established
49
+ - Layered placement: immutable identity facts go to the static layer; drifting interests and habits go to the dynamic layer with stale_after (renewed as observed)
50
+ - An assertion = one line of concrete, verifiable claim + inline evidence wikilink ('prefers concise Chinese replies' beats 'likes brevity'); a single incremental assertion is not directly promoted to a preference — preferences are patterns aggregated within the page
51
+ - Convergence-style updates: when a new value replaces an old one, a trace is left in the body (single line: who changed what, when); full-page rewrites are limited to profile construction/consolidation (preview shown, awaiting confirmation)
52
+ - First creation: the first trigger self-creates the page (frontmatter: type: profile + generated, dynamic layer carries stale_after), independent of any initialization mechanism
53
+ - Diary-type assets record only meta-signals (presence, cadence); content never enters the profile (the exemption followed mapping)
54
+ - Privacy red line: profile content is instance data, never entering the framework repo or test-repo
55
+ - Cognition bridge registration (a domain-plugin-side action, disclosed on this side): when a domain cognition plugin creates its archive and the profile is present, maintain one line in the profile's `## Domain Cognition` section (domain name + path-form wikilink); if the profile is absent, skip without proxy-creating it (on-demand bridge absence tolerance); multiple courses and archives register via the path-form wildcard (bb: <term>/<course> form)
56
+ <!-- /usage:user-profile -->
57
+
58
+ <!-- usage:trust -->
59
+ - When writing a page, write `generated` along the way (block style: `by: agent/<current-model>` / `at: <today>`)
60
+ - When a review action happens, append a `verified` event (single line `by: <actor>, at: <date>`), never fabricated to inflate the level
61
+ - Reviews are initiated by the user (triggered by human instruction); agents never append verified events on their own
62
+ <!-- /usage:trust -->
63
+
64
+ <!-- usage:index -->
65
+ - Post-write rebuild (mechanical, automatic): `python .meta/scripts/pipeline.py index` (index — overflow-offloading scheme, including deletion of obsolete old indexes after merge-back) and the same script's `tags` (tag reverse index); LLMs never hand-write indexes
66
+ <!-- /usage:index -->
67
+
68
+ <!-- usage:hot -->
69
+ - Writing entries (mechanical, automatic): `python .meta/scripts/pipeline.py hot <type> "<wikilink + one-sentence essence>"` (type value set same as log, see the log block of the AGENTS injection region); window eviction and truncation are performed by the script
70
+ <!-- /usage:hot -->
71
+
72
+ <!-- usage:log -->
73
+ - Writing lines (mechanical, automatic): `python .meta/scripts/pipeline.py log <type> "<one sentence>" [--domain <domain>]` (type value set in the log block of the AGENTS injection region; domain tag = domain-plugin name such as bb/lark/vault, mandatory for in-domain transactions, omitted for framework and native transactions); rolling window and archiving are performed by the script
74
+ <!-- /usage:log -->
75
+ <!-- cmd-inject:end -->
@@ -0,0 +1,48 @@
1
+ ---
2
+ name: query
3
+ owner: framework
4
+ consumes: [log]
5
+ description: "Retrieve from the wiki and answer synthetically: hot cache → index → grep → read pages, producing answers with wikilink citations. Triggers on: query, what do you know about, what is, explain, find in wiki, 检索."
6
+ ---
7
+
8
+ # query: retrieval
9
+
10
+ Read-mostly; the only write action is one log line (a read signal). Layered progression — the cheapest goes first.
11
+
12
+ ## Scope
13
+
14
+ Read: hot, index, tags, pages
15
+ Write: log (one line only, type "query")
16
+
17
+ ## Read Order
18
+
19
+ 1. wiki/hot.md (recent context, cheapest)
20
+ 2. wiki/index.md / wiki/tags.md (directory and tag indexes)
21
+ 3. grep (path / title / body keywords)
22
+ 4. Read specific pages to confirm (≤3-5 pages per query)
23
+
24
+ ## Answer Rules
25
+
26
+ - Output language takes the default key of the language declaration page `wiki/language.md` (a missing page or missing key falls back to the session language); page names are preserved as wikilinks
27
+ - Cite sources inline
28
+ - Explicitly flag contradictions with existing repository content
29
+
30
+ ## Not For
31
+
32
+ - Do not read the repository for general programming questions (training data already covers them)
33
+ - Do not read the repository for content already in the conversation or project files
34
+
35
+ ## Wrap-up
36
+
37
+ - Write one log line (a read signal — this is how read popularity becomes measurable): see the log block of the injection region for how to call it
38
+ - A log line is a data-zone change: commit immediately per the commit discipline (`检索: <topic>`, see `.meta/protocol/actions.md`); do not batch up
39
+
40
+ ## Injected Section (plugin usage blocks)
41
+
42
+ > This region is a wiki_plugin_kernel projection: consumes pulls merged with usage_routes source-side routing; disclosure order = owner first, routed blocks in the middle, pulled blocks last (rebuilt by inject / all); handwritten content does not belong here — to change the write-side contract, edit PLUGIN.yaml.
43
+
44
+ <!-- cmd-inject:start -->
45
+ <!-- usage:log -->
46
+ - Writing lines (mechanical, automatic): `python .meta/scripts/pipeline.py log <type> "<one sentence>" [--domain <domain>]` (type value set in the log block of the AGENTS injection region; domain tag = domain-plugin name such as bb/lark/vault, mandatory for in-domain transactions, omitted for framework and native transactions); rolling window and archiving are performed by the script
47
+ <!-- /usage:log -->
48
+ <!-- cmd-inject:end -->