AIWG 效果账本管理
effect-ledger
通过经签名的 AIWG 效果账本记录效果、签署效果、核对效果,或检查『该 PR 是否已合并』,使用单条 aiwg effect 命令并提供可脚本化的退出码。
- License 许可
- MIT
- 所属仓库
- jmagly/aiwg
- 最近更新
- 2026-11-14
- Stars
- ★ 229
- Forks
- 36
01 前言 Front Matter
- name
- effect-ledger
- namespace
- aiwg
- platforms
- [ "all" ]
- description
- Record an effect, sign an effect, reconcile an effect or check "did this PR merge" through the signed AIWG effect ledger, using one aiwg effect command with scriptable exit codes
03 SKILL.md 正文
Effect Ledger
Record and reconcile side effects (tracker comments, PR merges, issue closes,
git commits and tags, files, decision receipts) in the signed AIWG effect
ledger with the aiwg effect CLI. The ledger proves what AIWG recorded and
what a verifier observed. It never authorizes an effect and never replays one:
an operator decision authorizes, the ledger proves.
Triggers
- "record an effect" →
aiwg effect record - "sign an effect" →
aiwg effect record(signed intent and completed) - "reconcile effect" →
aiwg effect reconcile - "did this PR merge" →
aiwg effect reconcile --kind tracker.pr.merged, oraiwg effect probe --kind tracker.pr.merged --target gitea:owner/repo#34when no merge intent was recorded (read-only, writes nothing) - "did we already post this comment" →
aiwg effect lookupbefore posting - "verify the effect ledger" →
aiwg effect verify(add--with-decisions <audit.jsonl>to check #1567 operator-decision links) - "the effect ledger lock is stuck" →
aiwg effect recover-lock(operator only)
When to record
Record every externally visible effect that a retry or a crash could repeat: cycle and closing comments, merges, issue closes, tags, release files, and decision receipts. Do not record read-only queries.
Process
-
Name the effect. Pick the kind and target, and the causal context that makes it unique. For a cycle comment:
--kind tracker.comment --target gitea:owner/repo#12 --issue 12 --action cycle-comment --cycle 1.aiwg effect id <identity>prints the effect ID. -
Check before acting. Run
aiwg effect lookup <identity>. Exit 0 means the effect is already present: do not repeat it. Exit 4 means an earlier attempt has no outcome: runaiwg effect reconcilefirst. -
Carry the ID into the target wherever the target allows it: a hidden
<!-- aiwg-effect: <effect-id> -->line in a comment body, or anEffect-Id: <effect-id>git trailer. Verifiers use the marker to prove the effect happened. -
Perform the effect, then record and sign it in one call:
aiwg effect record --kind tracker.comment --target gitea:owner/repo#12 \ --issue 12 --action cycle-comment --cycle 1 --payload-file comment.mdrecordwrites the signed intent, runs the kind's verifier, and appendscompletedwhen the verifier reportspresent. Repeating it with the same payload exits 0 with"idempotent":true. Use--unverifiedonly when no verifier can see the target, and say so in your report. -
Reconcile uncertain effects.
aiwg effect reconcile <effect-id>(or the same identity flags) asks the verifier again and appends areconciledrecord each time. For "did this PR merge", once the merge intent is recorded:aiwg effect reconcile --kind tracker.pr.merged --target gitea:owner/repo#34. Reconciling an effect with no recorded intent is a usage error (exit 2); record the intent first withaiwg effect intentoraiwg effect record, or useaiwg effect probe <identity>for an ad-hoc check that records nothing (same exit codes 0, 3 and 4). -
Link the authorizing decision when an operator approved the effect:
--link operatorDecisionEventId=sha256:<hex>(andoperatorDecisionRecordHash) onintentorrecord.
Exit codes
| Code | Meaning | What to do |
|---|---|---|
| 0 | present or recorded | Continue |
| 3 | absent | The target does not show the effect. Do not assume it is safe to replay; follow the workflow's own policy |
| 4 | unknown | Stop and escalate. Never replay on unknown |
| 5 | conflict | The same effect ID was recorded with a different payload. Stop |
| 6 | integrity failure | The ledger failed verification. Stop and report |
| 2 / 1 / 7 | usage / internal / artifact root unavailable | Fix the command or the artifact root; nothing was written |
Rules
- Output is JSON by default and every document has a
schemamember; add--format textonly for people. - Never pass raw bodies, secrets or tokens as flags. Payloads are digested from
--payload-fileor given as--payload-digest. - The ledger key lives in the host secret service.
aiwg effect keys listshows key IDs and public keys only;keys initandkeys rotateare operator actions. aiwg effect recover-lock --lock <name> --authorizeis an operator action. It refuses live, reused or unverifiable lock owners and records the recovery in the ledger. Never run it without the operator's explicit approval.
References
- @$AIWG_ROOT/docs/contracts/effect-ledger.v1.md — contract, exit codes and verifier rules
- @$AIWG_ROOT/docs/cli/reference.md —
aiwg effectcommand reference
04 同仓库更多 Skills
plugin-search
Search marketplaces for plugins using configured local manifests and directory caches; rank matching plugins by observed installs, review tier and cache dates without installing or fetching anything
plugin-search
Search marketplaces for plugins using configured local manifests and directory caches; rank matching plugins by observed installs, review tier and cache dates without installing or fetching anything
host-hardening
Read-only system hardening baseline and plan-first host hardening recommendations for SSH, Docker bind addresses, firewall persistence, datastores, exporters and audit retention.
exposure-analysis
Read-only firewall analysis and effective host exposure reconstruction for Docker published ports, UFW bypass, stale rules, CDN scope, IPv6 asymmetry and external probe allowlists.
host-hardening
Read-only system hardening baseline and plan-first host hardening recommendations for SSH, Docker bind addresses, firewall persistence, datastores, exporters and audit retention.
exposure-analysis
Read-only firewall analysis and effective host exposure reconstruction for Docker published ports, UFW bypass, stale rules, CDN scope, IPv6 asymmetry and external probe allowlists.