owfadev 0.3.2 → 0.4.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/owfa-check/SKILL.md +49 -0
- package/.agents/skills/{docs → owfa-docs}/SKILL.md +5 -5
- package/.agents/skills/{wiki_plugin_kernel → owfa-kernel}/SKILL.md +13 -12
- package/{.meta/command/plugin → .agents/skills/owfa-plugin}/SKILL.md +10 -10
- package/.agents/skills/{query → owfa-query}/SKILL.md +5 -6
- package/.owfa/VERSION +1 -0
- package/.owfa/command/owfa-check/SKILL.md +49 -0
- package/{.meta/command/docs → .owfa/command/owfa-docs}/SKILL.md +5 -5
- package/{.meta/command/wiki_plugin_kernel → .owfa/command/owfa-kernel}/SKILL.md +13 -12
- package/{.agents/skills/plugin → .owfa/command/owfa-plugin}/SKILL.md +10 -10
- package/{.meta/command/query → .owfa/command/owfa-query}/SKILL.md +5 -6
- package/{.meta → .owfa}/docs/agent-behavior.md +3 -2
- package/{.meta → .owfa}/docs/agents-example.md +1 -1
- package/{.meta → .owfa}/docs/conversion.md +2 -2
- package/{.meta → .owfa}/docs/deployment.md +51 -46
- package/{.meta → .owfa}/docs/developer.md +4 -4
- package/{.meta → .owfa}/docs/distribution.md +21 -19
- package/.owfa/docs/home.md +61 -0
- package/{.meta → .owfa}/docs/intro.md +5 -5
- package/{.meta → .owfa}/docs/log-example.md +1 -1
- package/{.meta → .owfa}/docs/map.md +4 -3
- package/{.meta → .owfa}/docs/mechanics.md +11 -11
- package/{.meta → .owfa}/docs/naming.md +7 -7
- package/{.meta → .owfa}/docs/packages.md +80 -15
- package/.owfa/docs/plugin-lifecycle.md +70 -0
- package/{.meta → .owfa}/docs/quickstart.md +12 -12
- package/{.meta → .owfa}/docs/research-user-profile.md +1 -1
- package/{.meta → .owfa}/docs/sandbox.md +3 -3
- package/{.meta → .owfa}/docs/usage.md +1 -1
- package/{.meta → .owfa}/protocol/actions.md +6 -6
- package/.owfa/protocol/registry.yaml +34 -0
- package/.owfa/scripts/owfa_home.py +273 -0
- package/{.meta/scripts/wiki_plugin_kernel.py → .owfa/scripts/owfa_kernel.py} +521 -77
- package/{.meta → .owfa}/scripts/pipeline.py +9 -9
- package/.owfa/scripts/wiki_plugin_kernel.py +15 -0
- package/{.meta → .owfa}/scripts/wikilib.py +2 -2
- package/.owfa/tests/test_capabilities.py +311 -0
- package/{.meta → .owfa}/tests/test_install_preflight.py +11 -7
- package/.owfa/tests/test_owfa_home.py +127 -0
- package/.owfa/tests/test_version_scheme.py +63 -0
- package/README.md +32 -24
- package/README.zh-CN.md +32 -24
- package/bin/owfa.js +525 -65
- package/package.json +3 -2
- package/payloads/personal/PKG.yaml +15 -0
- package/payloads/personal/README.md +7 -0
- package/{.meta/plugins/core → payloads/personal}/calendar/PLUGIN.md +1 -0
- package/{.meta/plugins/core → payloads/personal}/calendar/PLUGIN.yaml +3 -3
- package/{.agents/skills/map → payloads/personal/command/owfa-map}/SKILL.md +9 -9
- package/{.meta/command/profile → payloads/personal/command/owfa-profile}/SKILL.md +11 -11
- package/{.agents/skills/save → payloads/personal/command/owfa-save}/SKILL.md +10 -10
- package/{.meta/plugins/core → payloads/personal}/cron/PLUGIN.md +2 -0
- package/{.meta/plugins/core → payloads/personal}/cron/PLUGIN.yaml +3 -3
- package/{.meta/plugins/core → payloads/personal}/device/PLUGIN.md +1 -0
- package/{.meta/plugins/core → payloads/personal}/device/PLUGIN.yaml +3 -3
- package/{.meta/plugins/core → payloads/personal}/domain/PLUGIN.md +2 -0
- package/payloads/personal/domain/PLUGIN.yaml +8 -0
- package/{.meta/plugins/core → payloads/personal}/hot/PLUGIN.yaml +1 -1
- package/{.meta/plugins/core → payloads/personal}/index/PLUGIN.md +1 -0
- package/{.meta/plugins/core → payloads/personal}/index/PLUGIN.yaml +4 -4
- package/{.meta/plugins/core → payloads/personal}/instance-git/PLUGIN.md +5 -0
- package/{.meta/plugins/core → payloads/personal}/instance-git/PLUGIN.yaml +3 -3
- package/{.meta/plugins/core → payloads/personal}/language/PLUGIN.md +1 -0
- package/{.meta/plugins/core → payloads/personal}/language/PLUGIN.yaml +4 -4
- package/{.meta/plugins/core → payloads/personal}/link/PLUGIN.md +1 -0
- package/{.meta/plugins/core → payloads/personal}/link/PLUGIN.yaml +3 -3
- package/{.meta/plugins/core → payloads/personal}/link/scripts/check.py +1 -1
- package/{.meta/plugins/core → payloads/personal}/log/PLUGIN.md +1 -0
- package/{.meta/plugins/core → payloads/personal}/log/PLUGIN.yaml +4 -4
- package/{.meta/plugins/core → payloads/personal}/mapping/PLUGIN.yaml +1 -1
- package/{.meta/plugins/core → payloads/personal}/notes/PLUGIN.md +1 -0
- package/{.meta/plugins/core → payloads/personal}/notes/PLUGIN.yaml +4 -4
- package/{.meta/plugins/core → payloads/personal}/sessions/PLUGIN.md +2 -1
- package/{.meta/plugins/core → payloads/personal}/sessions/PLUGIN.yaml +5 -5
- package/{.meta/plugins/core → payloads/personal}/structure/PLUGIN.md +2 -0
- package/{.meta/plugins/core → payloads/personal}/structure/PLUGIN.yaml +3 -3
- package/{.meta/plugins/core → payloads/personal}/structure/scripts/check.py +1 -1
- package/{.meta/plugins/core → payloads/personal}/tag/PLUGIN.md +2 -0
- package/{.meta/plugins/core → payloads/personal}/tag/PLUGIN.yaml +3 -3
- package/{.meta/plugins/core → payloads/personal}/tag/scripts/check.py +3 -1
- package/{.meta/plugins/core → payloads/personal}/tmp/PLUGIN.md +1 -0
- package/{.meta/plugins/core → payloads/personal}/tmp/PLUGIN.yaml +3 -3
- package/{.meta/plugins/core → payloads/personal}/todo/PLUGIN.md +2 -0
- package/{.meta/plugins/core → payloads/personal}/todo/PLUGIN.yaml +6 -5
- package/payloads/personal/todo/scripts/check.py +51 -0
- package/{.meta/plugins/core → payloads/personal}/trust/PLUGIN.md +1 -0
- package/{.meta/plugins/core → payloads/personal}/trust/PLUGIN.yaml +3 -3
- package/{.meta/plugins/core → payloads/personal}/user-profile/PLUGIN.md +2 -0
- package/{.meta/plugins/core → payloads/personal}/user-profile/PLUGIN.yaml +7 -6
- package/payloads/personal/user-profile/scripts/check.py +20 -0
- package/{.meta/plugins/core → payloads/personal}/vault/PLUGIN.md +1 -0
- package/payloads/personal/vault/PLUGIN.yaml +13 -0
- package/{.meta/plugins/core → payloads/personal}/wiki/PLUGIN.md +1 -0
- package/payloads/personal/wiki/PLUGIN.yaml +8 -0
- package/templates/AGENTS.template.md +2 -2
- package/.agents/skills/check/SKILL.md +0 -130
- package/.agents/skills/profile/SKILL.md +0 -75
- package/.meta/VERSION +0 -1
- package/.meta/command/check/SKILL.md +0 -130
- package/.meta/command/map/SKILL.md +0 -72
- package/.meta/command/save/SKILL.md +0 -94
- package/.meta/plugins/core/domain/PLUGIN.yaml +0 -8
- package/.meta/plugins/core/vault/PLUGIN.yaml +0 -13
- package/.meta/plugins/core/wiki/PLUGIN.yaml +0 -8
- package/.meta/protocol/registry.yaml +0 -75
- /package/{.meta → .owfa}/command/asset-read/SKILL.md +0 -0
- /package/{.meta → .owfa}/docs/research-landscape.md +0 -0
- /package/{.meta → .owfa}/protocol/experiments.md +0 -0
- /package/{.meta/plugins/core → payloads/personal}/device/scripts/check.py +0 -0
- /package/{.meta/plugins/core → payloads/personal}/hot/PLUGIN.md +0 -0
- /package/{.meta/plugins/core → payloads/personal}/instance-git/scripts/check.py +0 -0
- /package/{.meta/plugins/core → payloads/personal}/language/scripts/check.py +0 -0
- /package/{.meta/plugins/core → payloads/personal}/log/scripts/check.py +0 -0
- /package/{.meta/plugins/core → payloads/personal}/mapping/PLUGIN.md +0 -0
- /package/{.meta/plugins/core → payloads/personal}/mapping/scripts/check.py +0 -0
- /package/{.meta/plugins/core → payloads/personal}/sessions/scripts/check.py +0 -0
- /package/{.meta/plugins/core → payloads/personal}/trust/scripts/check.py +0 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: owfa-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
|
+
# owfa-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 owfa-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 (.owfa/, 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 .owfa/scripts/owfa_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 .owfa/scripts/owfa_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
|
+
- `.owfa/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 `.owfa/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 .owfa/scripts/owfa_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** (`.owfa/protocol/actions.md`): mechanical-automatic items are done directly — `pipeline.py index` / `tags` (index rebuild), `owfa_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 `.owfa/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 owfa-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
|
+
|
|
49
|
+
<!-- check-inject:end -->
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: docs
|
|
2
|
+
name: owfa-docs
|
|
3
3
|
owner: framework
|
|
4
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
5
|
---
|
|
6
6
|
|
|
7
|
-
# docs: thin router to the documentation layer
|
|
7
|
+
# owfa-docs: thin router to the documentation layer
|
|
8
8
|
|
|
9
9
|
S-layer pointer only — the norms live in the documents (L layer). Re-read what you cite; never quote from memory.
|
|
10
10
|
|
|
@@ -13,12 +13,12 @@ S-layer pointer only — the norms live in the documents (L layer). Re-read what
|
|
|
13
13
|
When the user reports dissatisfaction with your behavior, do **not** launch an analysis on your own:
|
|
14
14
|
|
|
15
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: [`.
|
|
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: [`.owfa/docs/agent-behavior.md`](../../docs/agent-behavior.md) — feedback handling → routing → the seven-step standard.
|
|
17
17
|
|
|
18
18
|
## 2. "Where is X documented?" / "how does X work?"
|
|
19
19
|
|
|
20
|
-
Read [`.
|
|
20
|
+
Read [`.owfa/docs/map.md`](../../docs/map.md) — the routing table (what to read when), framework docs and package-repo docs both.
|
|
21
21
|
|
|
22
22
|
## 3. Filing feedback / issues
|
|
23
23
|
|
|
24
|
-
The routing table lives in [`.
|
|
24
|
+
The routing table lives in [`.owfa/docs/agent-behavior.md`](../../docs/agent-behavior.md) §Routing: framework → owfa; package members → the matching `pkg-*` repo; new-plugin proposals → incubation on owfa.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
2
|
+
name: owfa-kernel
|
|
3
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: 插件内核,
|
|
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: 插件内核, owfa-kernel(旧 owfa-kernel), kernel, 注入块更新, 投影重建, 插件机制, 更新注入."
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
#
|
|
7
|
+
# owfa-kernel: kernel and mechanics reference
|
|
8
8
|
|
|
9
|
-
`python .
|
|
9
|
+
`python .owfa/scripts/owfa_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
10
|
|
|
11
11
|
## Subcommands
|
|
12
12
|
|
|
@@ -17,10 +17,10 @@ description: "Kernel and mechanics reference: the projector's subcommands (7 con
|
|
|
17
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
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
19
|
| `registry` | rebuilds the registry.yaml plugin section (from each manifest's `fields`) | registry.yaml |
|
|
20
|
-
| `deploy` | syncs skill masters (`.
|
|
20
|
+
| `deploy` | syncs skill masters (`.owfa/command/*/` commands + `connectors/*/` connectors) → `.agents/skills/` copies; orphan copies are reported only (deletion belongs to the human) | copies |
|
|
21
21
|
| `all` | validate + inject + registry + deploy in one step | all of the above |
|
|
22
22
|
|
|
23
|
-
Package lifecycle (full wizard protocol and judgment rules: `.
|
|
23
|
+
Package lifecycle (full wizard protocol and judgment rules: `.owfa/command/plugin/SKILL.md`):
|
|
24
24
|
|
|
25
25
|
| Subcommand | Purpose | Disk writes |
|
|
26
26
|
|---|---|---|
|
|
@@ -33,19 +33,19 @@ Package lifecycle (full wizard protocol and judgment rules: `.meta/command/plugi
|
|
|
33
33
|
| `pkg` | installed packages: members, versions, connectors | none |
|
|
34
34
|
| `residual <pkg>` | anchor-surface reference scan (the default teardown gate) | none |
|
|
35
35
|
|
|
36
|
-
The kernel journal (`.
|
|
36
|
+
The kernel journal (`.owfa/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
37
|
|
|
38
38
|
## Typical scenarios
|
|
39
39
|
|
|
40
|
-
- **PLUGIN.yaml changed** (inject / checks / usage / fields / version): `python .
|
|
41
|
-
- **Only refreshing injection blocks**: `inject` suffices, but note it modifies the `.
|
|
40
|
+
- **PLUGIN.yaml changed** (inject / checks / usage / fields / version): `python .owfa/scripts/owfa_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 `.owfa/command/` masters; copies sync only via `deploy` — hence always use `all` in daily work
|
|
42
42
|
- **Quick health check**: `validate` (structure) + `audit` (attached audit); a full audit (including semantic items) goes through the check command
|
|
43
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 `.
|
|
44
|
+
- **Connector skill changed** (`connectors/*/SKILL.md` master): run `deploy` (or `all`) to sync copies — connector skills never enter `.owfa/command/` (the command family is pure wiki operation)
|
|
45
45
|
|
|
46
46
|
## Plugin shape
|
|
47
47
|
|
|
48
|
-
- **One plugin, one directory** (`.
|
|
48
|
+
- **One plugin, one directory** (`.owfa/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
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
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
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
|
|
@@ -61,7 +61,8 @@ The kernel journal (`.meta/kernel-journal.log`, rolling cap of 500 lines, git-tr
|
|
|
61
61
|
|
|
62
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
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** (
|
|
64
|
+
- The projected plugin blocks carry a **byte budget** (16 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
|
+
- Each full-tier `inject` line has a **pointer-density guideline** (256 B, `INJECT_LINE_GUIDE`, issue #49): a longer line is a validate warning, never an error — write path + read/write trigger + the one easy-to-break invariant + a pointer to PLUGIN.md; detail moves to PLUGIN.md / usage / skills
|
|
65
66
|
|
|
66
67
|
## Command-plugin binding
|
|
67
68
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: plugin
|
|
2
|
+
name: owfa-plugin
|
|
3
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 .
|
|
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 .owfa/scripts/owfa_kernel.py; the agent runs the consent conversation and the one-shot commands. Triggers on: plugin, 插件, 装插件, 卸插件, 装包, install package, uninstall package."
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
# plugin: package lifecycle
|
|
7
|
+
# owfa-plugin: package lifecycle
|
|
8
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 `.
|
|
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 `.owfa/` by hand.
|
|
10
10
|
|
|
11
11
|
## Scope
|
|
12
12
|
|
|
@@ -17,10 +17,10 @@ Read: INDEX via the kernel, PKG.yaml, manifests
|
|
|
17
17
|
|
|
18
18
|
When a user asks to install a package and has NOT already specified what to include:
|
|
19
19
|
|
|
20
|
-
1. `python .
|
|
20
|
+
1. `python .owfa/scripts/owfa_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
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
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 .
|
|
23
|
+
4. Execute: `python .owfa/scripts/owfa_kernel.py install <pkg> --without <unwanted> [--yes]`
|
|
24
24
|
5. Report the convergence output (validate/inject/registry/deploy) in one breath
|
|
25
25
|
|
|
26
26
|
## One-shot path (agent / pre-authorized)
|
|
@@ -28,8 +28,8 @@ When a user asks to install a package and has NOT already specified what to incl
|
|
|
28
28
|
If consent already exists (user named exactly what they want, or pre-authorized), skip the conversation:
|
|
29
29
|
|
|
30
30
|
```
|
|
31
|
-
python .
|
|
32
|
-
python .
|
|
31
|
+
python .owfa/scripts/owfa_kernel.py plan <pkg> --json # machine-readable plan (optional)
|
|
32
|
+
python .owfa/scripts/owfa_kernel.py install <pkg> [--without a,b] [--yes]
|
|
33
33
|
```
|
|
34
34
|
|
|
35
35
|
Kernel commands never prompt — every invocation completes in one shot.
|
|
@@ -58,12 +58,12 @@ Every package transaction (install / uninstall / upgrade apply / migrate clear)
|
|
|
58
58
|
|
|
59
59
|
Mechanical sync is only half an update. When a new version carries `migrations/`:
|
|
60
60
|
|
|
61
|
-
1. The kernel stages declarations into `.
|
|
61
|
+
1. The kernel stages declarations into `.owfa/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
62
|
2. `kernel migrate <pkg>` prints the staged declarations (init or version-chain) — relay them in the user's language
|
|
63
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
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
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 (`.
|
|
66
|
+
6. The kernel journal (`.owfa/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
67
|
|
|
68
68
|
## Boundaries
|
|
69
69
|
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: query
|
|
2
|
+
name: owfa-query
|
|
3
3
|
owner: framework
|
|
4
|
-
consumes: [log]
|
|
5
4
|
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
5
|
---
|
|
7
6
|
|
|
8
|
-
# query: retrieval
|
|
7
|
+
# owfa-query: retrieval
|
|
9
8
|
|
|
10
9
|
Read-mostly; the only write action is one log line (a read signal). Layered progression — the cheapest goes first.
|
|
11
10
|
|
|
@@ -35,14 +34,14 @@ Write: log (one line only, type "query")
|
|
|
35
34
|
## Wrap-up
|
|
36
35
|
|
|
37
36
|
- 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 `.
|
|
37
|
+
- A log line is a data-zone change: commit immediately per the commit discipline (`检索: <topic>`, see `.owfa/protocol/actions.md`); do not batch up
|
|
39
38
|
|
|
40
39
|
## Injected Section (plugin usage blocks)
|
|
41
40
|
|
|
42
|
-
> This region is a
|
|
41
|
+
> This region is a owfa-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
42
|
|
|
44
43
|
<!-- cmd-inject:start -->
|
|
45
44
|
<!-- usage:log -->
|
|
46
|
-
- Writing lines (mechanical, automatic): `python .
|
|
45
|
+
- Writing lines (mechanical, automatic): `python .owfa/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
46
|
<!-- /usage:log -->
|
|
48
47
|
<!-- cmd-inject:end -->
|
package/.owfa/VERSION
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.4.0
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: owfa-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
|
+
# owfa-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 owfa-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 (.owfa/, 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 .owfa/scripts/owfa_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 .owfa/scripts/owfa_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
|
+
- `.owfa/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 `.owfa/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 .owfa/scripts/owfa_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** (`.owfa/protocol/actions.md`): mechanical-automatic items are done directly — `pipeline.py index` / `tags` (index rebuild), `owfa_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 `.owfa/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 owfa-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
|
+
|
|
49
|
+
<!-- check-inject:end -->
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: docs
|
|
2
|
+
name: owfa-docs
|
|
3
3
|
owner: framework
|
|
4
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
5
|
---
|
|
6
6
|
|
|
7
|
-
# docs: thin router to the documentation layer
|
|
7
|
+
# owfa-docs: thin router to the documentation layer
|
|
8
8
|
|
|
9
9
|
S-layer pointer only — the norms live in the documents (L layer). Re-read what you cite; never quote from memory.
|
|
10
10
|
|
|
@@ -13,12 +13,12 @@ S-layer pointer only — the norms live in the documents (L layer). Re-read what
|
|
|
13
13
|
When the user reports dissatisfaction with your behavior, do **not** launch an analysis on your own:
|
|
14
14
|
|
|
15
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: [`.
|
|
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: [`.owfa/docs/agent-behavior.md`](../../docs/agent-behavior.md) — feedback handling → routing → the seven-step standard.
|
|
17
17
|
|
|
18
18
|
## 2. "Where is X documented?" / "how does X work?"
|
|
19
19
|
|
|
20
|
-
Read [`.
|
|
20
|
+
Read [`.owfa/docs/map.md`](../../docs/map.md) — the routing table (what to read when), framework docs and package-repo docs both.
|
|
21
21
|
|
|
22
22
|
## 3. Filing feedback / issues
|
|
23
23
|
|
|
24
|
-
The routing table lives in [`.
|
|
24
|
+
The routing table lives in [`.owfa/docs/agent-behavior.md`](../../docs/agent-behavior.md) §Routing: framework → owfa; package members → the matching `pkg-*` repo; new-plugin proposals → incubation on owfa.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
2
|
+
name: owfa-kernel
|
|
3
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: 插件内核,
|
|
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: 插件内核, owfa-kernel(旧 owfa-kernel), kernel, 注入块更新, 投影重建, 插件机制, 更新注入."
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
#
|
|
7
|
+
# owfa-kernel: kernel and mechanics reference
|
|
8
8
|
|
|
9
|
-
`python .
|
|
9
|
+
`python .owfa/scripts/owfa_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
10
|
|
|
11
11
|
## Subcommands
|
|
12
12
|
|
|
@@ -17,10 +17,10 @@ description: "Kernel and mechanics reference: the projector's subcommands (7 con
|
|
|
17
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
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
19
|
| `registry` | rebuilds the registry.yaml plugin section (from each manifest's `fields`) | registry.yaml |
|
|
20
|
-
| `deploy` | syncs skill masters (`.
|
|
20
|
+
| `deploy` | syncs skill masters (`.owfa/command/*/` commands + `connectors/*/` connectors) → `.agents/skills/` copies; orphan copies are reported only (deletion belongs to the human) | copies |
|
|
21
21
|
| `all` | validate + inject + registry + deploy in one step | all of the above |
|
|
22
22
|
|
|
23
|
-
Package lifecycle (full wizard protocol and judgment rules: `.
|
|
23
|
+
Package lifecycle (full wizard protocol and judgment rules: `.owfa/command/plugin/SKILL.md`):
|
|
24
24
|
|
|
25
25
|
| Subcommand | Purpose | Disk writes |
|
|
26
26
|
|---|---|---|
|
|
@@ -33,19 +33,19 @@ Package lifecycle (full wizard protocol and judgment rules: `.meta/command/plugi
|
|
|
33
33
|
| `pkg` | installed packages: members, versions, connectors | none |
|
|
34
34
|
| `residual <pkg>` | anchor-surface reference scan (the default teardown gate) | none |
|
|
35
35
|
|
|
36
|
-
The kernel journal (`.
|
|
36
|
+
The kernel journal (`.owfa/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
37
|
|
|
38
38
|
## Typical scenarios
|
|
39
39
|
|
|
40
|
-
- **PLUGIN.yaml changed** (inject / checks / usage / fields / version): `python .
|
|
41
|
-
- **Only refreshing injection blocks**: `inject` suffices, but note it modifies the `.
|
|
40
|
+
- **PLUGIN.yaml changed** (inject / checks / usage / fields / version): `python .owfa/scripts/owfa_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 `.owfa/command/` masters; copies sync only via `deploy` — hence always use `all` in daily work
|
|
42
42
|
- **Quick health check**: `validate` (structure) + `audit` (attached audit); a full audit (including semantic items) goes through the check command
|
|
43
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 `.
|
|
44
|
+
- **Connector skill changed** (`connectors/*/SKILL.md` master): run `deploy` (or `all`) to sync copies — connector skills never enter `.owfa/command/` (the command family is pure wiki operation)
|
|
45
45
|
|
|
46
46
|
## Plugin shape
|
|
47
47
|
|
|
48
|
-
- **One plugin, one directory** (`.
|
|
48
|
+
- **One plugin, one directory** (`.owfa/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
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
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
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
|
|
@@ -61,7 +61,8 @@ The kernel journal (`.meta/kernel-journal.log`, rolling cap of 500 lines, git-tr
|
|
|
61
61
|
|
|
62
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
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** (
|
|
64
|
+
- The projected plugin blocks carry a **byte budget** (16 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
|
+
- Each full-tier `inject` line has a **pointer-density guideline** (256 B, `INJECT_LINE_GUIDE`, issue #49): a longer line is a validate warning, never an error — write path + read/write trigger + the one easy-to-break invariant + a pointer to PLUGIN.md; detail moves to PLUGIN.md / usage / skills
|
|
65
66
|
|
|
66
67
|
## Command-plugin binding
|
|
67
68
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: plugin
|
|
2
|
+
name: owfa-plugin
|
|
3
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 .
|
|
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 .owfa/scripts/owfa_kernel.py; the agent runs the consent conversation and the one-shot commands. Triggers on: plugin, 插件, 装插件, 卸插件, 装包, install package, uninstall package."
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
# plugin: package lifecycle
|
|
7
|
+
# owfa-plugin: package lifecycle
|
|
8
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 `.
|
|
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 `.owfa/` by hand.
|
|
10
10
|
|
|
11
11
|
## Scope
|
|
12
12
|
|
|
@@ -17,10 +17,10 @@ Read: INDEX via the kernel, PKG.yaml, manifests
|
|
|
17
17
|
|
|
18
18
|
When a user asks to install a package and has NOT already specified what to include:
|
|
19
19
|
|
|
20
|
-
1. `python .
|
|
20
|
+
1. `python .owfa/scripts/owfa_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
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
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 .
|
|
23
|
+
4. Execute: `python .owfa/scripts/owfa_kernel.py install <pkg> --without <unwanted> [--yes]`
|
|
24
24
|
5. Report the convergence output (validate/inject/registry/deploy) in one breath
|
|
25
25
|
|
|
26
26
|
## One-shot path (agent / pre-authorized)
|
|
@@ -28,8 +28,8 @@ When a user asks to install a package and has NOT already specified what to incl
|
|
|
28
28
|
If consent already exists (user named exactly what they want, or pre-authorized), skip the conversation:
|
|
29
29
|
|
|
30
30
|
```
|
|
31
|
-
python .
|
|
32
|
-
python .
|
|
31
|
+
python .owfa/scripts/owfa_kernel.py plan <pkg> --json # machine-readable plan (optional)
|
|
32
|
+
python .owfa/scripts/owfa_kernel.py install <pkg> [--without a,b] [--yes]
|
|
33
33
|
```
|
|
34
34
|
|
|
35
35
|
Kernel commands never prompt — every invocation completes in one shot.
|
|
@@ -58,12 +58,12 @@ Every package transaction (install / uninstall / upgrade apply / migrate clear)
|
|
|
58
58
|
|
|
59
59
|
Mechanical sync is only half an update. When a new version carries `migrations/`:
|
|
60
60
|
|
|
61
|
-
1. The kernel stages declarations into `.
|
|
61
|
+
1. The kernel stages declarations into `.owfa/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
62
|
2. `kernel migrate <pkg>` prints the staged declarations (init or version-chain) — relay them in the user's language
|
|
63
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
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
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 (`.
|
|
66
|
+
6. The kernel journal (`.owfa/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
67
|
|
|
68
68
|
## Boundaries
|
|
69
69
|
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: query
|
|
2
|
+
name: owfa-query
|
|
3
3
|
owner: framework
|
|
4
|
-
consumes: [log]
|
|
5
4
|
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
5
|
---
|
|
7
6
|
|
|
8
|
-
# query: retrieval
|
|
7
|
+
# owfa-query: retrieval
|
|
9
8
|
|
|
10
9
|
Read-mostly; the only write action is one log line (a read signal). Layered progression — the cheapest goes first.
|
|
11
10
|
|
|
@@ -35,14 +34,14 @@ Write: log (one line only, type "query")
|
|
|
35
34
|
## Wrap-up
|
|
36
35
|
|
|
37
36
|
- 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 `.
|
|
37
|
+
- A log line is a data-zone change: commit immediately per the commit discipline (`检索: <topic>`, see `.owfa/protocol/actions.md`); do not batch up
|
|
39
38
|
|
|
40
39
|
## Injected Section (plugin usage blocks)
|
|
41
40
|
|
|
42
|
-
> This region is a
|
|
41
|
+
> This region is a owfa-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
42
|
|
|
44
43
|
<!-- cmd-inject:start -->
|
|
45
44
|
<!-- usage:log -->
|
|
46
|
-
- Writing lines (mechanical, automatic): `python .
|
|
45
|
+
- Writing lines (mechanical, automatic): `python .owfa/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
46
|
<!-- /usage:log -->
|
|
48
47
|
<!-- cmd-inject:end -->
|
|
@@ -17,8 +17,9 @@ This face was previously undeclared (an e-class vacuum live sample, #33's improv
|
|
|
17
17
|
|
|
18
18
|
| Feedback | Destination | Test |
|
|
19
19
|
|---|---|---|
|
|
20
|
-
| kernel / mechanics / projections /
|
|
21
|
-
|
|
|
20
|
+
| kernel / mechanics / projections / framework docs | owfa | framework contract face |
|
|
21
|
+
| core-suite plugins (the former framework plugins, now owfa-personal members) | the **owfa-personal** repo (since the v0.4 split) | plugin id ∈ owfa-personal `PKG.members` |
|
|
22
|
+
| package member plugins (the bb family, the lark family, …) | the matching `owfa-*` repo | plugin id ∈ `PKG.members`; repo address in the registry INDEX |
|
|
22
23
|
| behavior deviations (the #34 face) | wherever the plugin lives | behavior contracts live in PLUGIN.md |
|
|
23
24
|
| new plugin proposals | owfa (incubation; moves with the package when it lands) | no owning repo yet |
|
|
24
25
|
| unclear | file on owfa; maintainers transfer | fallback (#20 precedent) |
|
|
@@ -11,7 +11,7 @@ rewritten freely — the agent never edits outside the injection region.>
|
|
|
11
11
|
## Layout
|
|
12
12
|
|
|
13
13
|
<vault root>: `vault/` real assets · `wiki/` the md world
|
|
14
|
-
· `.
|
|
14
|
+
· `.owfa/` + `.agents/skills/` the framework body (packages under `.owfa/plugins/domains/`).
|
|
15
15
|
|
|
16
16
|
## Git
|
|
17
17
|
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
## Eight steps
|
|
6
6
|
|
|
7
7
|
1. **Baseline commit** at the instance root — the rollback anchor
|
|
8
|
-
2. **Survey**: `ls .
|
|
9
|
-
3. **Swap the framework trees**: delete `.
|
|
8
|
+
2. **Survey**: `ls .owfa/plugins` (a flat list = legacy), `ls .owfa/command`, `ls .agents/skills` — note any *non-framework* skills you keep (the drill kept `dsh-token`)
|
|
9
|
+
3. **Swap the framework trees**: delete `.owfa/{plugins,command,scripts,protocol,docs}` and the framework entries of `.agents/skills/` (keep your own tool skills); copy in the template's `.owfa/{plugins,command,scripts,protocol,docs,VERSION}` and `.agents/skills/*`. Data zones (`wiki/`, `vault/`, domain data directories), `connectors/`, `AGENTS.md`, `.gitignore` are never touched
|
|
10
10
|
4. **Converge**: `kernel all` — core 21 green; the AGENTS injection region rebuilds wholesale (the old flat blocks are replaced)
|
|
11
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
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`
|