owfadev 0.0.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/asset-read/SKILL.md +39 -0
- package/.agents/skills/check/SKILL.md +130 -0
- package/.agents/skills/docs/SKILL.md +24 -0
- package/.agents/skills/map/SKILL.md +72 -0
- package/.agents/skills/plugin/SKILL.md +74 -0
- package/.agents/skills/profile/SKILL.md +75 -0
- package/.agents/skills/query/SKILL.md +48 -0
- package/.agents/skills/save/SKILL.md +94 -0
- package/.agents/skills/wiki_plugin_kernel/SKILL.md +104 -0
- package/.meta/VERSION +1 -0
- package/.meta/command/asset-read/SKILL.md +39 -0
- package/.meta/command/check/SKILL.md +130 -0
- package/.meta/command/docs/SKILL.md +24 -0
- package/.meta/command/map/SKILL.md +72 -0
- package/.meta/command/plugin/SKILL.md +74 -0
- package/.meta/command/profile/SKILL.md +75 -0
- package/.meta/command/query/SKILL.md +48 -0
- package/.meta/command/save/SKILL.md +94 -0
- package/.meta/command/wiki_plugin_kernel/SKILL.md +104 -0
- package/.meta/docs/agent-behavior.md +68 -0
- package/.meta/docs/agents-example.md +34 -0
- package/.meta/docs/conversion.md +24 -0
- package/.meta/docs/deployment.md +311 -0
- package/.meta/docs/developer.md +33 -0
- package/.meta/docs/distribution.md +132 -0
- package/.meta/docs/intro.md +56 -0
- package/.meta/docs/log-example.md +19 -0
- package/.meta/docs/map.md +23 -0
- package/.meta/docs/mechanics.md +180 -0
- package/.meta/docs/naming.md +113 -0
- package/.meta/docs/packages.md +130 -0
- package/.meta/docs/quickstart.md +79 -0
- package/.meta/docs/research-landscape.md +132 -0
- package/.meta/docs/research-user-profile.md +27 -0
- package/.meta/docs/sandbox.md +40 -0
- package/.meta/docs/usage.md +45 -0
- package/.meta/plugins/core/calendar/PLUGIN.md +35 -0
- package/.meta/plugins/core/calendar/PLUGIN.yaml +21 -0
- package/.meta/plugins/core/cron/PLUGIN.md +38 -0
- package/.meta/plugins/core/cron/PLUGIN.yaml +24 -0
- package/.meta/plugins/core/device/PLUGIN.md +38 -0
- package/.meta/plugins/core/device/PLUGIN.yaml +21 -0
- package/.meta/plugins/core/device/scripts/check.py +29 -0
- package/.meta/plugins/core/domain/PLUGIN.md +43 -0
- package/.meta/plugins/core/domain/PLUGIN.yaml +8 -0
- package/.meta/plugins/core/hot/PLUGIN.md +40 -0
- package/.meta/plugins/core/hot/PLUGIN.yaml +15 -0
- package/.meta/plugins/core/index/PLUGIN.md +39 -0
- package/.meta/plugins/core/index/PLUGIN.yaml +18 -0
- package/.meta/plugins/core/instance-git/PLUGIN.md +39 -0
- package/.meta/plugins/core/instance-git/PLUGIN.yaml +15 -0
- package/.meta/plugins/core/instance-git/scripts/check.py +90 -0
- package/.meta/plugins/core/language/PLUGIN.md +38 -0
- package/.meta/plugins/core/language/PLUGIN.yaml +23 -0
- package/.meta/plugins/core/language/scripts/check.py +23 -0
- package/.meta/plugins/core/link/PLUGIN.md +39 -0
- package/.meta/plugins/core/link/PLUGIN.yaml +16 -0
- package/.meta/plugins/core/link/scripts/check.py +122 -0
- package/.meta/plugins/core/log/PLUGIN.md +58 -0
- package/.meta/plugins/core/log/PLUGIN.yaml +18 -0
- package/.meta/plugins/core/log/scripts/check.py +21 -0
- package/.meta/plugins/core/mapping/PLUGIN.md +32 -0
- package/.meta/plugins/core/mapping/PLUGIN.yaml +24 -0
- package/.meta/plugins/core/mapping/scripts/check.py +90 -0
- package/.meta/plugins/core/notes/PLUGIN.md +42 -0
- package/.meta/plugins/core/notes/PLUGIN.yaml +19 -0
- package/.meta/plugins/core/sessions/PLUGIN.md +63 -0
- package/.meta/plugins/core/sessions/PLUGIN.yaml +20 -0
- package/.meta/plugins/core/sessions/scripts/check.py +33 -0
- package/.meta/plugins/core/structure/PLUGIN.md +29 -0
- package/.meta/plugins/core/structure/PLUGIN.yaml +18 -0
- package/.meta/plugins/core/structure/scripts/check.py +32 -0
- package/.meta/plugins/core/tag/PLUGIN.md +37 -0
- package/.meta/plugins/core/tag/PLUGIN.yaml +18 -0
- package/.meta/plugins/core/tag/scripts/check.py +28 -0
- package/.meta/plugins/core/tmp/PLUGIN.md +26 -0
- package/.meta/plugins/core/tmp/PLUGIN.yaml +16 -0
- package/.meta/plugins/core/todo/PLUGIN.md +33 -0
- package/.meta/plugins/core/todo/PLUGIN.yaml +22 -0
- package/.meta/plugins/core/trust/PLUGIN.md +70 -0
- package/.meta/plugins/core/trust/PLUGIN.yaml +23 -0
- package/.meta/plugins/core/trust/scripts/check.py +77 -0
- package/.meta/plugins/core/user-profile/PLUGIN.md +39 -0
- package/.meta/plugins/core/user-profile/PLUGIN.yaml +30 -0
- package/.meta/plugins/core/vault/PLUGIN.md +28 -0
- package/.meta/plugins/core/vault/PLUGIN.yaml +13 -0
- package/.meta/plugins/core/wiki/PLUGIN.md +37 -0
- package/.meta/plugins/core/wiki/PLUGIN.yaml +8 -0
- package/.meta/protocol/actions.md +42 -0
- package/.meta/protocol/experiments.md +40 -0
- package/.meta/protocol/registry.yaml +75 -0
- package/.meta/scripts/pipeline.py +428 -0
- package/.meta/scripts/wiki_plugin_kernel.py +1846 -0
- package/.meta/scripts/wikilib.py +79 -0
- package/LICENSE +21 -21
- package/README.md +98 -15
- package/bin/owfa.js +540 -0
- package/package.json +36 -7
- package/templates/AGENTS.template.md +19 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: save
|
|
3
|
+
owner: [notes, sessions]
|
|
4
|
+
consumes: [notes, sessions, trust, index, hot, log]
|
|
5
|
+
description: "Save the current conversation, answers, or insights as wiki native notes. Deduplicate before filing, infer type and title, chunk-extract long sessions, update index/log/hot cache. Triggers on: save this, /save, file this, save to wiki, 保存."
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# save: capture
|
|
9
|
+
|
|
10
|
+
Good answers should not vanish in chat history. Save what was just discussed as permanent wiki pages. The wiki compounds through it — save often.
|
|
11
|
+
|
|
12
|
+
## Scope
|
|
13
|
+
|
|
14
|
+
Write: sessions (session backbone pages), notes (native notes), log, hot, index
|
|
15
|
+
Read: registry (`.meta/protocol/registry.yaml`, field and value-set anchor), tag (vocabulary `wiki/tags.md`), trust (generated), index / hot (dedup prerequisites)
|
|
16
|
+
|
|
17
|
+
## Dedup Before Filing (required)
|
|
18
|
+
|
|
19
|
+
1. Read wiki/hot.md and wiki/index.md for recent context
|
|
20
|
+
2. Search existing pages by title and key concepts
|
|
21
|
+
3. A related page exists: never rewrite directly — show the differences and let the user adjudicate (append-style merging requires a user instruction and leaves traces, or the human edits by hand, or a new page is created); partial overlap: likewise, show the differences and let the user choose
|
|
22
|
+
4. Create a new page only after confirming none covers it
|
|
23
|
+
|
|
24
|
+
## Type and Destination
|
|
25
|
+
|
|
26
|
+
type / status value sets defer to the registry (a one-time read anchor; do not re-copy the table); ask only on genuine ambiguity. Destination splits by type: session goes to the long-sessions section below, other native types land in `wiki/notes/` (per-type destinations and contracts in the injection region); the source type is out of scope here — anything with a vault counterpart goes through map.
|
|
27
|
+
|
|
28
|
+
## Workflow
|
|
29
|
+
|
|
30
|
+
1. **Anchor (one-time read)**: read `.meta/protocol/registry.yaml` and `wiki/tags.md` — type / status value sets and the existing vocabulary are visible before writing
|
|
31
|
+
2. Scan the conversation for high-value content (non-obvious insights, decisions with reasons, hard-won analyses, comparisons that will be cited again); skip mechanical Q&A / debugging processes / content already in the repository
|
|
32
|
+
3. Set the type (ask only on genuine ambiguity) and title (ask only on ambiguity or conflict)
|
|
33
|
+
4. Rewrite in declarative present tense: write knowledge, not dialogue
|
|
34
|
+
5. Create the page per the write-side contracts in the injection region (notes / sessions destinations and shapes, trust generated, tag labeling); the session type goes to the long-sessions section
|
|
35
|
+
6. Write wiki pages mentioned in the conversation into related with wikilinks
|
|
36
|
+
7. **Post-write pipeline** (deterministic, mechanical, automatic): 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 (`保存: <page title>`, see `.meta/protocol/actions.md`)
|
|
37
|
+
8. Report: `Saved as [[title]] in wiki/notes/` (session type: `... in wiki/sessions/`)
|
|
38
|
+
|
|
39
|
+
## Long Sessions (session backbone)
|
|
40
|
+
|
|
41
|
+
1. Split into 3-8 sections by topic (not by message count); merge and drop mechanical details
|
|
42
|
+
2. Create the session backbone page: destination, default naming, participants, backbone-page shape, and promotion rules in the sessions block of the injection region
|
|
43
|
+
3. Ask about the title only on genuine ambiguity
|
|
44
|
+
|
|
45
|
+
## Writing Rules
|
|
46
|
+
|
|
47
|
+
Declarative present tense; 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); every concept / page mentioned gets a wikilink; a future session must be able to cold-read this page.
|
|
48
|
+
|
|
49
|
+
## Parameters
|
|
50
|
+
|
|
51
|
+
- `/save` saves the whole session; `/save <topic>` saves only that topic; `--force` skips confirmation (only when conflict-free)
|
|
52
|
+
|
|
53
|
+
## Injected Section (plugin usage blocks)
|
|
54
|
+
|
|
55
|
+
> 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.
|
|
56
|
+
|
|
57
|
+
<!-- cmd-inject:start -->
|
|
58
|
+
<!-- usage:notes -->
|
|
59
|
+
- Landing spot `wiki/notes/<title>.md`, file name free (named by humans); type form vocabulary in registry (open, self-extended by instances), territory values do not land in this zone
|
|
60
|
+
- Append-only: commands never rewrite an existing note wholesale; updating = append-style merge under user instruction (trace left in the body) or manual human edits
|
|
61
|
+
<!-- /usage:notes -->
|
|
62
|
+
|
|
63
|
+
<!-- usage:sessions -->
|
|
64
|
+
- Landing spot `wiki/sessions/YYYY-MM-DD-<topic>.md` (default naming), type: session, participants required (actor list)
|
|
65
|
+
- Backbone page five-section shape: Core Conclusions / Decisions & Rationale / Non-obvious Insights / Open Questions / Related Pages (full-shape sample in the Example section of `.meta/plugins/sessions/PLUGIN.md`)
|
|
66
|
+
- Standalone high-value topics promoted to `wiki/notes/` pages, the backbone page keeping a wikilink; dedupe before promotion
|
|
67
|
+
<!-- /usage:sessions -->
|
|
68
|
+
|
|
69
|
+
<!-- usage:language -->
|
|
70
|
+
- Register discipline: follow the language.register audience reading level when writing saved artifacts; absent register uses the program baseline (first/second-year undergraduates), while explicit user audience requirements and domain source-alignment rules take precedence
|
|
71
|
+
- When to read: read the declaration page before writing any artifact (wiki pages, documents, lecture distillates); page or key absent = follow the session language (conversation language is the output language); proper nouns, code, paths, commands, and file names always keep their original form (language neutrality, invariant under configuration) — the framework presets no specific language; Chinese is merely an instance fact of this project's development period (AGENTS principle 7)
|
|
72
|
+
- Term discipline: when writing hits a term, consult the `terms` mapping first — if tabled, follow the table; otherwise annotate the original in parentheses on first occurrence (e.g. '检索增强生成 (RAG)'), registering only after recurring hits (emergence-based); a registered entry = a single line original→translation, long notes (translation rationale, usage examples) go to the body distillation section
|
|
73
|
+
- Layering: a default baseline, not a mandate — the domain plugins' source-alignment discipline (exam language follows samples/course materials) takes precedence over this page; tag word forms belong to tag, forms of address and personal dynamic preferences belong to user-profile, in-domain term tables (the bb courseware glossary) are self-managed within the domain — none of these are restated on this page
|
|
74
|
+
- Maintenance: the `language` mapping is human-defined first, the agent may propose; the `terms` mapping may be registered by the agent but never overwrites human-defined entries (objections reported); the body distillation section is append-only
|
|
75
|
+
<!-- /usage:language -->
|
|
76
|
+
|
|
77
|
+
<!-- usage:trust -->
|
|
78
|
+
- When writing a page, write `generated` along the way (block style: `by: agent/<current-model>` / `at: <today>`)
|
|
79
|
+
- When a review action happens, append a `verified` event (single line `by: <actor>, at: <date>`), never fabricated to inflate the level
|
|
80
|
+
- Reviews are initiated by the user (triggered by human instruction); agents never append verified events on their own
|
|
81
|
+
<!-- /usage:trust -->
|
|
82
|
+
|
|
83
|
+
<!-- usage:index -->
|
|
84
|
+
- 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
|
|
85
|
+
<!-- /usage:index -->
|
|
86
|
+
|
|
87
|
+
<!-- usage:hot -->
|
|
88
|
+
- 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
|
|
89
|
+
<!-- /usage:hot -->
|
|
90
|
+
|
|
91
|
+
<!-- usage:log -->
|
|
92
|
+
- 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
|
|
93
|
+
<!-- /usage:log -->
|
|
94
|
+
<!-- cmd-inject:end -->
|
|
@@ -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
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Agent behavior analysis & feedback protocol
|
|
2
|
+
|
|
3
|
+
> L-layer home of the #34 ruling (C variant): the session is the full record, the issue carries the standardized artifact. Reader class: agents (via deployed copies) and developers. The analysis is generated by the agent itself, from its own loop context. Written 2026-10-13.
|
|
4
|
+
|
|
5
|
+
## Feedback handling — the behavior face, now declared
|
|
6
|
+
|
|
7
|
+
When the user reports dissatisfaction with agent behavior:
|
|
8
|
+
|
|
9
|
+
1. **Immediate fix first** — stop the offending pattern in-session, never continue it while analyzing
|
|
10
|
+
2. **Judge the responsible layer** — plugin constraint? framework? pure execution? Not a plugin/kernel matter → no analysis: respond to the user directly
|
|
11
|
+
3. **Consent gate** — if it may be a plugin/kernel problem, offer the self-audit to the user (recommended, never forced); start only on consent
|
|
12
|
+
4. **Systematic → behavior analysis** (below); one-off → in-session fix + one log line, no issue
|
|
13
|
+
|
|
14
|
+
This face was previously undeclared (an e-class vacuum live sample, #33's improvised handling).
|
|
15
|
+
|
|
16
|
+
## Routing — where feedback goes
|
|
17
|
+
|
|
18
|
+
| Feedback | Destination | Test |
|
|
19
|
+
|---|---|---|
|
|
20
|
+
| kernel / mechanics / projections / core plugins / framework docs | owfa | framework contract face |
|
|
21
|
+
| package member plugins (the bb family, the lark family, …) | the matching `pkg-*` repo | plugin id ∈ `PKG.members`; repo address in the registry INDEX |
|
|
22
|
+
| behavior deviations (the #34 face) | wherever the plugin lives | behavior contracts live in PLUGIN.md |
|
|
23
|
+
| new plugin proposals | owfa (incubation; moves with the package when it lands) | no owning repo yet |
|
|
24
|
+
| unclear | file on owfa; maintainers transfer | fallback (#20 precedent) |
|
|
25
|
+
|
|
26
|
+
## Triage gate — step 0, not passed means no analysis
|
|
27
|
+
|
|
28
|
+
① Systematic (the same scene recurs)? ② Reproducible (survives a session change)? ③ Constraint-related (not pure execution)? All three — otherwise: fix in-session + one log line, do not generate an analysis.
|
|
29
|
+
|
|
30
|
+
## The analysis standard — seven steps
|
|
31
|
+
|
|
32
|
+
**1. Anchor the event.** Locate the deviation point. Quote verbatim: the user instruction (U layer) + the user's correction.
|
|
33
|
+
|
|
34
|
+
**2. Reconstruct the behavior chain (fact layer).** From the U-layer instruction, list the actions that actually happened, each with four fields:
|
|
35
|
+
- **Action**: what was read / written / called / generated
|
|
36
|
+
- **Basis**: a re-read verbatim quote (injection line / AGENTS.md / skill body / PLUGIN.md / session context) — never from memory
|
|
37
|
+
- **Owning plugin**: ownerless steps marked "framework / system layer"
|
|
38
|
+
- **Trace**: tool-call records / file reads-writes / log entries
|
|
39
|
+
|
|
40
|
+
Only steps with verifiable traces enter this layer; steps that cannot be confirmed move to step 5 (interpretation).
|
|
41
|
+
|
|
42
|
+
**3. Expected behavior — two sources, recorded separately.**
|
|
43
|
+
- **Declared expectation**: re-read the plugin's L layer (PLUGIN.md behavior contract owns/activates/offers/withholds, the injection line) — quote it, or write "undeclared"
|
|
44
|
+
- **User expectation**: the correction verbatim, from step 1
|
|
45
|
+
|
|
46
|
+
**4. Locate the deviation.** Actual vs expected, item by item. Against declared expectation = a compliance diff; against user expectation = a demand signal. List separately.
|
|
47
|
+
|
|
48
|
+
**5. Attribution (interpretation layer).** Five classes, multiple allowed, each with a confidence (high/medium/low), a verbatim constraint quote, and the minimal fix if it holds:
|
|
49
|
+
|
|
50
|
+
| Class | Meaning | Destination |
|
|
51
|
+
|---|---|---|
|
|
52
|
+
| a constraint defect | wrong / ambiguous / over-executed | fix the plugin |
|
|
53
|
+
| b constraint conflict | two plugins give inconsistent instructions | fix the plugins (priority or wording) |
|
|
54
|
+
| c not delivered | member-tier exit / skill not loaded | check tier and dependency chain |
|
|
55
|
+
| d execution deviation | constraint present, not followed (model side) | not a plugin problem; record, change nothing |
|
|
56
|
+
| e spec vacuum | no constraint covers the behavior | add a behavior contract |
|
|
57
|
+
|
|
58
|
+
**6. Suggested change.** Minimal fix + blast radius (which other scenes depend on this constraint). The agent proposes; weighing and deciding belong to the developer.
|
|
59
|
+
|
|
60
|
+
**7. Artifact.** Output the full analysis in the `.github/ISSUE_TEMPLATE/agent-behavior.md` format, confirm with the user, file it on the owning repo per the routing table above.
|
|
61
|
+
|
|
62
|
+
## Red lines
|
|
63
|
+
|
|
64
|
+
- Quotes must be re-read from the source; reproducing constraint text from memory is forbidden
|
|
65
|
+
- The fact layer holds no speculation; all speculation goes to the interpretation layer with a confidence mark
|
|
66
|
+
- Attribution classification is mandatory — a blanket "the plugin is buggy" is not accepted
|
|
67
|
+
- The `agent-behavior` word root (kept distinct from the user-behavior plugin, per the #34 terminology ruling)
|
|
68
|
+
- Artifacts land on GitHub issues, never in the instance wiki
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# AGENTS.md — instance seed example
|
|
2
|
+
|
|
3
|
+
> The framework repo itself carries no AGENTS.md (library posture — dev rules live in README/CONTRIBUTING). This is the seed an instance drafts at deployment step ③ of the deployment guide. Keep it short: one identity paragraph, one layout paragraph, the injection region verbatim.
|
|
4
|
+
|
|
5
|
+
```markdown
|
|
6
|
+
# <vault name> — personal/instance library
|
|
7
|
+
|
|
8
|
+
<One paragraph: what this instance is for, whose, what lives here. Written by the human,
|
|
9
|
+
rewritten freely — the agent never edits outside the injection region.>
|
|
10
|
+
|
|
11
|
+
## Layout
|
|
12
|
+
|
|
13
|
+
<vault root>: `vault/` real assets · `wiki/` the md world
|
|
14
|
+
· `.meta/` + `.agents/skills/` the framework body (packages under `.meta/plugins/domains/`).
|
|
15
|
+
|
|
16
|
+
## Git
|
|
17
|
+
|
|
18
|
+
Instance snapshots follow the instance-git plugin (core) — the agent commits at transaction close (`type: summary`); beyond that contract, git usage is the human's own.
|
|
19
|
+
|
|
20
|
+
<!-- wiki-inject:start -->
|
|
21
|
+
|
|
22
|
+
## wiki 注入区
|
|
23
|
+
|
|
24
|
+
> 本区为插件注入的投影,装卸插件时同步增删对应标记块;手写内容不进此区。
|
|
25
|
+
|
|
26
|
+
<!-- wiki-inject:end -->
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Rules of thumb:
|
|
30
|
+
|
|
31
|
+
- The **injection region markers** (`<!-- wiki-inject:start -->` … `<!-- wiki-inject:end -->`) are copied verbatim; everything inside is kernel-managed — hand-writing there is lost on the next `kernel all`
|
|
32
|
+
- Everything **outside** the region is yours; the agent treats it as constitution-level context
|
|
33
|
+
- After the mechanical run, the region fills with one `<!-- plugin:<id> v<x.y> -->` block per full-tier plugin — that is the structural contract surfaces to every future session
|
|
34
|
+
- The injection region has a hard byte budget (kernel-checked): if a package's roster line overflows it, re-tier members rather than trimming the region by hand
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Converting a legacy instance (pre-split flat layout) to the package era
|
|
2
|
+
|
|
3
|
+
> Walked end-to-end on a real instance (2026-10-13 conversion drill: 35 flat plugins → core 21 + 5 registry packages, 36 green, all inits cleared on real assets). Before you start: **commit a baseline** — the conversion is a snapshot boundary; if anything goes wrong, `git checkout` back.
|
|
4
|
+
|
|
5
|
+
## Eight steps
|
|
6
|
+
|
|
7
|
+
1. **Baseline commit** at the instance root — the rollback anchor
|
|
8
|
+
2. **Survey**: `ls .meta/plugins` (a flat list = legacy), `ls .meta/command`, `ls .agents/skills` — note any *non-framework* skills you keep (the drill kept `dsh-token`)
|
|
9
|
+
3. **Swap the framework trees**: delete `.meta/{plugins,command,scripts,protocol,docs}` and the framework entries of `.agents/skills/` (keep your own tool skills); copy in the template's `.meta/{plugins,command,scripts,protocol,docs,VERSION}` and `.agents/skills/*`. Data zones (`wiki/`, `vault/`, domain data directories), `connectors/`, `AGENTS.md`, `.gitignore` are never touched
|
|
10
|
+
4. **Converge**: `kernel all` — core 21 green; the AGENTS injection region rebuilds wholesale (the old flat blocks are replaced)
|
|
11
|
+
5. **Install packages**: `kernel list-remote`, then `kernel install <pkg> --yes` per package. Connectors already present are **kept existing** (running venvs survive; connector code updates arrive via uninstall+install of the owning package)
|
|
12
|
+
6. **Clear the inits**: `kernel migrate <pkg>` prints each declaration; a real instance usually already satisfies the verify criteria (identity / profile / declaration pages exist on real assets) → `kernel migrate <pkg> --clear`
|
|
13
|
+
7. **Derived layer**: `pipeline.py index` (idempotent rebuild); `hot.md` needs no rebuild — entries are managed per-write with window eviction
|
|
14
|
+
8. **Close the transaction**: one commit (`plugin: converted to the package era …`) + a log line; `kernel upgrade` should now report framework and every package up to date
|
|
15
|
+
|
|
16
|
+
## Findings from the drill (already baked into the mechanism)
|
|
17
|
+
|
|
18
|
+
- **Injection budget**: a fully-loaded instance (core 21 + all five packages) projects ~15.7K — the original 15 KiB budget (a core-20-era figure) was raised to 16 KiB; the 16K harness floor stays the anchor
|
|
19
|
+
- **Existing connectors kept on install** (conservative semantics) — credential dirs and venvs are never touched
|
|
20
|
+
- The **tri-face pending warning** makes the mid-conversion state visible in every session; clearing inits on real assets typically passes verify in one shot
|
|
21
|
+
|
|
22
|
+
## If something breaks
|
|
23
|
+
|
|
24
|
+
The baseline commit is your exit: `git log` finds it, `git checkout` restores the framework trees. Data zones were never touched — the worst case is a framework redo, never data loss.
|