@etiquekit/etq 1.0.4 → 1.0.5
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/bin/etiquette
CHANGED
|
@@ -178,7 +178,7 @@ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.pus
|
|
|
178
178
|
`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(r){let n=r.items[r.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){let t="end"in n.value?n.value.end:void 0;if((Array.isArray(t)?t[t.length-1]:void 0)?.type==="comment")t?.push(this.sourceToken);else r.items.push({start:[this.sourceToken]})}else if(n.sep)n.sep.push(this.sourceToken);else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)r.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,r.indent)){let e=r.items[r.items.length-2]?.value?.end;if(Array.isArray(e)){Array.prototype.push.apply(e,n.start),e.push(this.sourceToken),r.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=r.indent){let t=!this.onKeyLine&&this.indent===r.indent,e=t&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind",i=[];if(e&&n.sep&&!n.value){let _=[];for(let c=0;c<n.sep.length;++c){let o=n.sep[c];switch(o.type){case"newline":_.push(c);break;case"space":break;case"comment":if(o.indent>r.indent)_.length=0;break;default:_.length=0}}if(_.length>=2)i=n.sep.splice(_[1])}switch(this.type){case"anchor":case"tag":if(e||n.value)i.push(this.sourceToken),r.items.push({start:i}),this.onKeyLine=!0;else if(n.sep)n.sep.push(this.sourceToken);else n.start.push(this.sourceToken);return;case"explicit-key-ind":if(!n.sep&&!n.explicitKey)n.start.push(this.sourceToken),n.explicitKey=!0;else if(e||n.value)i.push(this.sourceToken),r.items.push({start:i,explicitKey:!0});else this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]});this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(!n.sep)if(qt(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{let _=be(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:_,key:null,sep:[this.sourceToken]}]})}else if(n.value)r.items.push({start:[],key:null,sep:[this.sourceToken]});else if(qt(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(X0(n.key)&&!qt(n.sep,"newline")){let _=be(n.start),c=n.key,o=n.sep;o.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:_,key:c,sep:o}]})}else if(i.length>0)n.sep=n.sep.concat(i,this.sourceToken);else n.sep.push(this.sourceToken);else if(!n.sep)Object.assign(n,{key:null,sep:[this.sourceToken]});else if(n.value||e)r.items.push({start:i,key:null,sep:[this.sourceToken]});else if(qt(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else n.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let _=this.flowScalar(this.type);if(e||n.value)r.items.push({start:i,key:_,sep:[]}),this.onKeyLine=!0;else if(n.sep)this.stack.push(_);else Object.assign(n,{key:_,sep:[]}),this.onKeyLine=!0;return}default:{let _=this.startBlockValue(r);if(_){if(_.type==="block-seq"){if(!n.explicitKey&&n.sep&&!qt(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else if(t)r.items.push({start:i});this.stack.push(_);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(r){let n=r.items[r.items.length-1];switch(this.type){case"newline":if(n.value){let t="end"in n.value?n.value.end:void 0;if((Array.isArray(t)?t[t.length-1]:void 0)?.type==="comment")t?.push(this.sourceToken);else r.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)r.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,r.indent)){let e=r.items[r.items.length-2]?.value?.end;if(Array.isArray(e)){Array.prototype.push.apply(e,n.start),e.push(this.sourceToken),r.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=r.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==r.indent)break;if(n.value||qt(n.start,"seq-item-ind"))r.items.push({start:[this.sourceToken]});else n.start.push(this.sourceToken);return}if(this.indent>r.indent){let t=this.startBlockValue(r);if(t){this.stack.push(t);return}}yield*this.pop(),yield*this.step()}*flowCollection(r){let n=r.items[r.items.length-1];if(this.type==="flow-error-end"){let t;do yield*this.pop(),t=this.peek(1);while(t?.type==="flow-collection")}else if(r.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!n||n.sep)r.items.push({start:[this.sourceToken]});else n.start.push(this.sourceToken);return;case"map-value-ind":if(!n||n.value)r.items.push({start:[],key:null,sep:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!n||n.value)r.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let e=this.flowScalar(this.type);if(!n||n.value)r.items.push({start:[],key:e,sep:[]});else if(n.sep)this.stack.push(e);else Object.assign(n,{key:e,sep:[]});return}case"flow-map-end":case"flow-seq-end":r.end.push(this.sourceToken);return}let t=this.startBlockValue(r);if(t)this.stack.push(t);else yield*this.pop(),yield*this.step()}else{let t=this.peek(2);if(t.type==="block-map"&&(this.type==="map-value-ind"&&t.indent===r.indent||this.type==="newline"&&!t.items[t.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&t.type!=="flow-collection"){let e=f$(t),i=be(e);V0(r);let _=r.end.splice(1,r.end.length);_.push(this.sourceToken);let c={type:"block-map",offset:r.offset,indent:r.indent,items:[{start:i,key:r,sep:_}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=c}else yield*this.lineEnd(r)}}flowScalar(r){if(this.onNewLine){let n=this.source.indexOf(`
|
|
179
179
|
`)+1;while(n!==0)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
180
180
|
`,n)+1}return{type:r,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(r){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let n=f$(r),t=be(n);return t.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let n=f$(r),t=be(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(r,n){if(this.type!=="comment")return!1;if(this.indent<=n)return!1;return r.every((t)=>t.type==="newline"||t.type==="space")}*documentEnd(r){if(this.type!=="doc-mode"){if(r.end)r.end.push(this.sourceToken);else r.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd(r){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:if(r.end)r.end.push(this.sourceToken);else r.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}jA.Parser=B0});var C0=j((GA)=>{var H0=M6(),PA=p_(),ec=s_(),JA=CI(),AA=Z(),kA=C6(),Y0=Z6();function Q0(r){let n=r.prettyErrors!==!1;return{lineCounter:r.lineCounter||n&&new kA.LineCounter||null,prettyErrors:n}}function vA(r,n={}){let{lineCounter:t,prettyErrors:e}=Q0(n),i=new Y0.Parser(t?.addNewLine),_=new H0.Composer(n),c=Array.from(_.compose(i.parse(r)));if(e&&t)for(let o of c)o.errors.forEach(ec.prettifyError(r,t)),o.warnings.forEach(ec.prettifyError(r,t));if(c.length>0)return c;return Object.assign([],{empty:!0},_.streamInfo())}function K0(r,n={}){let{lineCounter:t,prettyErrors:e}=Q0(n),i=new Y0.Parser(t?.addNewLine),_=new H0.Composer(n),c=null;for(let o of _.compose(i.parse(r),!0,r.length))if(!c)c=o;else if(c.options.logLevel!=="silent"){c.errors.push(new ec.YAMLParseError(o.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(e&&t)c.errors.forEach(ec.prettifyError(r,t)),c.warnings.forEach(ec.prettifyError(r,t));return c}function MA(r,n,t){let e=void 0;if(typeof n==="function")e=n;else if(t===void 0&&n&&typeof n==="object")t=n;let i=K0(r,t);if(!i)return null;if(i.warnings.forEach((_)=>JA.warn(i.options.logLevel,_)),i.errors.length>0)if(i.options.logLevel!=="silent")throw i.errors[0];else i.errors=[];return i.toJS(Object.assign({reviver:e},t))}function FA(r,n,t){let e=null;if(typeof n==="function"||Array.isArray(n))e=n;else if(t===void 0&&n)t=n;if(typeof t==="string")t=t.length;if(typeof t==="number"){let i=Math.round(t);t=i<1?void 0:i>8?{indent:8}:{indent:i}}if(r===void 0){let{keepUndefined:i}=t??n??{};if(!i)return}if(AA.isDocument(r)&&!e)return r.toString(t);return new PA.Document(r,e,t).toString(t)}GA.parse=MA;GA.parseAllDocuments=vA;GA.parseDocument=K0;GA.stringify=FA});function Me(){return["etiquette","","Govern agent-assisted engineering work with seats, evidence, and promotion gates.","","Start here:"," etiquette setup [--target auto|codex|claude-code|gemini|all] [--project <path>] [--yes]"," etiquette handoff [--project <path>] [--profile codex-cc-gemini|lead-review] [--task-prefix <id>]"," etiquette init [--project <path>]"," etiquette bootstrap local [--project <path>] [--profile codex-cc-gemini|lead-review]"," etiquette whereami [--project <path>] [--seat <id>] [--task <ref>] [--json]"," etiquette doctor [--project <path>]"," etiquette status [--project <path>]","","Daily work:"," etiquette join --seat <id> [--project <path>] [--json]"," etiquette pickup --seat <id> --task <ref> --expect-project-id <id> [--project <path>] [--text|--json]"," etiquette enter <task> --seat <id> --operator <principal> [--project <path>]"," etiquette session create --seat <id> --task <ref> [--project <path>]"," etiquette notify poll --seat <id> [--project <path>] [--after-seq <n>] [--json]"," etiquette notify webhook github --payload <file> --delivery <id> --event push --signature-256 <sha256=...> [--json]"," etiquette return check --task <ref> --seat <id> [--remote-runner] [--project <path>] [--json]"," etiquette retire <path> --reason <kind> --evidence-ref <ref> --removed-by <seat> [--project <path>]"," etiquette diagnostics runner-glitch --symptom <text> [--session <id>] [--project <path>]"," etiquette diagnostics no-return --task <ref> --seat <id> [--project <path>] [--json]"," etiquette dispatch scaffold [--project <path>] [--task-id <id>] [--seat <id>] [--out <dir>]"," etiquette dispatch check --mode <path> --task <path> [--project <path>] [--json]"," etiquette dispatch record --mode <path> --task <path> [--project <path>] [--json]"," etiquette bus view [--project <path>] [--lane <id>] [--seat <id>] [--since <n>] [--format text|json|markdown]"," etiquette timeline view [--project <path>] [--scope project|seat|lane|principal] [--seat <id>] [--lane <id>]"," etiquette timeline preview [--project <path>] [--scope project|seat|lane|principal] [--seat <id>] [--lane <id>] [--host 127.0.0.1] [--port 4174] # loopback only"," etiquette ledger index|search|show ...","","Seats and readiness:"," etiquette seat readiness --seat <id> [--project <path>] [--json]"," etiquette seat status [--project <path>] [--json]"," etiquette seat owner-card --manifest <path> [--project <path>] [--json]","","Management views:"," etiquette console board [--project <path>] [--seat <id>] [--text]"," etiquette console serve [--project <path>] [--host 127.0.0.1] [--port 4173]","","Release checks:"," etiquette release readiness [--project <path>] [--json]"," etiquette release ga-readiness [--project <path>] --channel <name> --verify-tag-remote <remote> [--json]","","Advanced surfaces:"," etiquette help advanced"," etiquette-core help","","Authority boundary:"," commands can initialize, check, record evidence, and project read models;"," they do not grant authority, merge, close work, publish, or promote truth."].join(`
|
|
181
|
-
`)}function UT(){return["etiquette advanced command catalog","","usage (supervision \u2014 Phase 1, etiquette/internal/docs/supervision/PHASE1.md):"," discipline session-open <session-id> --campaign-root <path> --objective <text> --lead <seat> --responder <seat>"," --escalation-owner <seat> --time-cap <minutes> --turn-cap <n> --source-ref a,b [--topic <text>] [--seat-manifest <path>]"," discipline session-status <session-id> --campaign-root <path> [--json] [--seat-manifest <path>]"," discipline turn-open <session-id> --campaign-root <path> --owner <seat> --action-class <class>"," --max-duration <minutes> --allowed-command a,b --repo-root a,b --owned-path a,b"," --forbidden-path a,b --verify-command a,b [--requires-human-approval]"," [--projection-policy on_state_change|on_command_only] [--seat-manifest <path>]"," discipline turn-close <session-id> --campaign-root <path> --turn <turn-id>"," --result <done|blocked|handed_off|stopped|timed_out> --summary <text> [--evidence-ref a,b]"," discipline session-command <session-id> <command> --campaign-root <path>"," [--actor <seat>] [--payload <json>] [--seat-manifest <path>]"," discipline session-project <session-id> --campaign-root <path>"," discipline session-rebuild <session-id> --campaign-root <path>"," discipline seat-validate [--manifest <path>]","","usage (memory spine \u2014 local-first, compact-then-exact):"," etiquette memory index [--project <path>] [--db <path>] [--local-private] [--json]"," etiquette memory index --export [<dir>] --org-id <opaque-id> --confirm-shared-export"," [--workspace-id <opaque-id>] [--project <path>] [--db <path>] [--json]"," etiquette memory search <query> [--project <path>] [--db <path>] [--limit <n>] [--json]"," etiquette memory show <capsule-id> [--project <path>] [--db <path>]"," etiquette memory preflight <lane-or-task> [--project <path>] [--db <path>] [--limit <n>] [--json]"," etiquette memory context [<query>] [--lane <ref>] [--task <ref>] [--query <text>]"," [--workspace-id <opaque-id>] [--org-id <opaque-id>] [--project <path>] [--db <path>] [--limit <n>] [--json]"," etiquette memory status [--project <path>] [--db <path>] [--root <path>] [--json]"," etiquette memory store init --store <id> --scope org|workspace|lane|seat|session --access read_only|read_write"," [--mount-mode filesystem_like|context_pack|mcp_resource] [--write-policy none|candidate_only|curator_promoted]"," [--project <path>] [--root <path>] [--at <iso8601>] [--json]"," etiquette memory store add --store <id> --path <repo-relative> --content <text> --evidence <type:ref,...>"," [--project <path>] [--root <path>] [--at <iso8601>] [--json]"," etiquette memory store list [--project <path>] [--root <path>] [--json]"," etiquette memory store show --store <id> [--project <path>] [--root <path>] [--json]"," etiquette memory consolidate --input <store-id,...> --out <store-id> [--project <path>] [--root <path>] [--at <iso8601>] [--json]"," etiquette memory drain-import --from-project <child-path> --from-store <id> --to-store <id>"," [--project <parent-path>] [--from-root <path>] [--to-root <path>] [--source-ref <ref>] [--target-ref <ref>]"," [--path-prefix <repo-relative>] [--receipt <path>] [--at <iso8601>] [--json]"," etiquette memory sharded-drain-import --shard <id=child-path,...> --from-store <id> --to-store <id>"," [--project <parent-path>] [--target-ref <ref>] [--receipt-dir <repo-dir>] [--receipt <path>] [--json]"," etiquette memory stale [--project <path>] [--db <path>] [--limit <n>] [--json]"," etiquette memory rejected [--project <path>] [--db <path>] [--limit <n>] [--json]","","usage (console v0 - read-only local management view):"," etiquette console snapshot [--project <path>] [--json]"," etiquette console board [--project <path>] [--seat <id>] [--text]"," etiquette console serve [--project <path>] [--host 127.0.0.1] [--port 4173]","","usage (local workspace workflow v0 - repo-local onboarding, no hidden authority):"," etiquette setup [--target auto|all|codex|claude-code|gemini] [--project <path>]"," [--dry-run] [--force] [--eject] [--json]"," etiquette handoff [--project <path>] [--profile codex-cc-gemini|lead-review] [--task-prefix <id>] [--json]"," etiquette init [--project <path>]"," etiquette bootstrap local [--project <path>] [--profile codex-cc-gemini|lead-review]"," [--task-prefix <id>] [--lead-seat <id>] [--lead-principal <id>]"," [--review-seat <id>] [--review-principal <id>] [--qa-seat <id>] [--qa-principal <id>]"," [--bootstrap-seat <id>] [--bootstrap-principal <id>] [--no-qa] [--force] [--json]"," etiquette whereami [--project <path>] [--seat <id>] [--task <ref>] [--json]"," etiquette join --seat <id> [--project <path>] [--json]"," etiquette pickup --seat <id> --task <ref> [--project <path>] [--text|--json]"," etiquette enter <task> --seat <id> --operator <principal> [--project <path>]"," etiquette session create --seat <id> --task <ref> [--session-id <id>] [--operator <id>]"," [--owner <id>] [--target-ref <ref>] [--creation-mode explicit|dynamic] [--project <path>] [--json]"," etiquette session note --session <id> --section plan|tool|retry|evidence|note --message <text>"," [--project <path>] [--json]"," etiquette session migrate-project [--project <path>] [--dry-run] [--json]"," etiquette audit append --actor <id> --action <id> [--project <path>] [--refs a,b]"," etiquette roster card validate --card <path>"," etiquette roster enroll <seat> --card <path> --operator-principal <id> --execution-seat <id>"," --as-role <role> --authority-scope <scope> --mode <mode> --orientation-ref <path> [--project <path>]"," etiquette roster ready <seat> --ack-ref <ref> --orientation-ref <path> [--project <path>]"," etiquette roster list|show|posture <seat> [--project <path>] [--json]"," etiquette roster doctor [--project <path>] [--cards <dir>] [--json]"," etiquette post --role <role> --lane <id> --from <seat> --to <seat> [--emit] [--project <path>]"," etiquette notify subscribe --seat <id> --lane <id> [--roles a,b] [--project <path>]"," etiquette notify feed --seat <id> [--project <path>] [--text]"," etiquette notify poll --seat <id> [--project <path>] [--after-seq <n>] [--limit <n>] [--text|--json]"," etiquette notify queue --seat <id> [--project <path>] [--text|--json]"," etiquette notify webhook github --payload <file> --delivery <id> --event push --signature-256 <sha256=...>"," [--secret-env ETIQUETTE_GITHUB_WEBHOOK_SECRET] [--text|--json]"," etiquette return check --task <ref> --seat <id> [--role any|implementation-return|review-return]"," [--tier local-advisory|remote-runner-hard-gate] [--remote-runner] [--project <path>] [--json]"," etiquette retire <path> --reason superseded|rejected|closed|duplicate --evidence-ref <ref>"," --removed-by <seat> [--superseded-by <path>] [--project <path>] [--json]"," etiquette trash list|show|restore|rebuild ... [--project <path>] [--json]"," etiquette rig doctor [--project <path>]"," etiquette bus status [n] [--project <path>] [--text]"," etiquette bus inbox --addressee <seat> [--project <path>] [--text]"," etiquette bus view [--project <path>] [--lane <id>] [--seat <id>] [--role <role>]"," [--since <n|local://event/n>] [--until <n|local://event/n>] [--match <text>]"," [--kind all|events|packets] [--limit <n>] [--format text|json|markdown]"," etiquette timeline view [--project <path>] [--scope project|seat|lane|principal] [--seat <id>] [--lane <id>]"," [--since <n|local://event/n>] [--until <n|local://event/n>] [--match <text>] [--limit <n>]"," [--format text|json|markdown]"," etiquette timeline preview [--project <path>] [--scope project|seat|lane|principal] [--seat <id>] [--lane <id>]"," [--since <n|local://event/n>] [--until <n|local://event/n>] [--match <text>] [--limit <n>]"," [--host 127.0.0.1] [--port 4174] # loopback only"," etiquette diagnostics runner-glitch --symptom <text> [--runner <id>] [--session <id>]"," [--command-ref <summary>] [--severity info|warning|blocked] [--project <path>] [--json]"," etiquette diagnostics no-return --task <ref> --seat <id> [--role any|implementation-return|review-return]"," [--project <path>] [--json]"," etiquette status [--project <path>]","","usage (ledger retrieval v0.1 - local generated index, compact-then-exact):"," etiquette ledger index [--project <path>] [--db <path>] [--json]"," etiquette ledger search <query> [--project <path>] [--db <path>] [--limit <n>] [--json]"," etiquette ledger search --topic <slug> [--project <path>] [--db <path>] [--limit <n>] [--json]"," etiquette ledger show <entry-or-ref-id> [--project <path>] [--db <path>]","","usage (hook adapter v0.1 \u2014 optional, disabled-by-default, opt in via ETIQUETTE_HOOKS_ENABLED=1):"," etiquette hook session_start [--workspace <id>] [--payload <json>]"," etiquette hook user_prompt_submit [--workspace <id>] [--payload <json>]"," etiquette hook post_tool_use [--workspace <id>] [--payload <json>]"," etiquette hook stop [--workspace <id>] [--payload <json>]"," etiquette hook session_end [--workspace <id>] [--payload <json>]","","usage (harness maintenance v0 - pruning receipts, inventory, and canary checks; no deletion authority):"," etiquette harness receipt --receipt <path> [--json]"," etiquette harness inventory --manifest <path> [--project <path>] [--json]"," etiquette harness canary --receipt <path> [--json]","","usage (rubric runner v0.1 - local sandbox evidence, no authority activation):"," etiquette rubric validate --rubric <path> [--json]"," etiquette rubric sandbox --rubric <path> --fixtures <path> --run-by <seat>"," [--environment local|sandbox-isolated] [--at <iso8601>] [--receipt <path>] [--json]"," etiquette rubric promote-check --rubric <path> --receipt <path>"," [--policy <path>] [--grant-ref <ref>] [--json]","","usage (release readiness v0 - package/channel checks, no publish authority):"," etiquette release channels [--json]"," etiquette release readiness [--project <path>] [--json] [--fail-on-blocked]"," etiquette release ga-readiness [--project <path>] --channel <name>"," --verify-tag-remote <remote> [--json] [--fail-on-blocked]","","usage (infra runtime \u2014 source-only, not shipped in the local devkit):"," runtime verifier cells, kube plans, and EKS provisioning belong to an infra/runtime workspace.","","usage (seat capability heartbeat v0.1 - local-first routing metadata):"," etiquette seat readiness --seat <id> [--project <path>] [--state <path>]"," [--seat-type control_seat|execution_seat|review_seat|seat_maintainer]"," [--execution-surface <opaque-id>] [--capability-source config|local_validation|seat_doctor|agent_self_declared]"," [--operational-status operational|degraded|blocked|offline]"," [--model-tier lite_fast|balanced|frontier_high_reasoning|local_unknown] [--model-id <opaque-id>]"," [--active-workers <n>] [--max-recommended-workers <n>] [--supports-parallel true|false]"," [--supported-strategies a,b] [--unsupported-strategies a,b] [--constraints a,b] [--json]"," etiquette seat heartbeat [--project <path>] [--state <path>] [--seat <id>]"," [--operational-status operational|degraded|blocked|offline] [--active-workers <n>] [--constraints a,b] [--json]"," etiquette seat status [--project <path>] [--state <path>] [--json]"," etiquette seat owner-card --manifest <path> [--project <path>] [--state <path>] [--at <iso8601>] [--json]","","usage (workflow mode consumer v0.1 - advisory-only policy preset checks):"," etiquette workflow validate --mode <path> [--json]"," etiquette workflow explain <deliberative|expedient|mixed> [--json]"," etiquette workflow check --mode <path> --task <path> [--json]","","usage (workspace authority v0 - personal-local, org-remote, runtime-cell roots):"," etiquette workspace authority --profile <path> [--json]","","usage (operational dispatch consumer v0 - advisory wiring, no execution):"," etiquette dispatch scaffold [--project <path>] [--task-id <id>] [--seat <id>] [--out <dir>] [--json]"," etiquette dispatch check --mode <path> --task <path> [--project <path>] [--state <path>]"," [--sandbox-receipt <path>] [--strategy <id>] [--at <iso8601>] [--json]"," etiquette dispatch record --mode <path> --task <path> [--project <path>] [--state <path>]"," [--sandbox-receipt <path>] [--strategy <id>] [--at <iso8601>] [--recorded-by <seat>] [--json]"," etiquette dispatch projection --record <path> [--artifact-ref <ref>] [--receipt-ref <repo-ref>]"," [--status success|partial|blocked|failed] [--validation-summary <text>] [--json]","","usage (local-remote sync outbox v0 - local staging only, no network):"," etiquette sync stage [--project <path>] [--outbox <path>] [--workspace-id <opaque-id>]"," [--org-id <opaque-id>] [--seat-id <opaque-id>] [--at <iso8601>] [--json]"," etiquette sync join-plan --invite <path> --joined-by <seat> --claim-ref <ref>"," [--at <iso8601>] [--json]"," etiquette sync git-driver-status [--project <path>] [--driver-name etqseq] [--json]"," etiquette sync install-git-merge-driver [--project <path>] [--driver-name etqseq]"," [--driver-command <command>] [--skip-git-config] [--json]"].join(`
|
|
181
|
+
`)}function UT(){return["etiquette advanced command catalog","","usage (supervision \u2014 Phase 1, etiquette/internal/docs/supervision/PHASE1.md):"," discipline session-open <session-id> --campaign-root <path> --objective <text> --lead <seat> --responder <seat>"," --escalation-owner <seat> --time-cap <minutes> --turn-cap <n> --source-ref a,b [--topic <text>] [--seat-manifest <path>]"," discipline session-status <session-id> --campaign-root <path> [--json] [--seat-manifest <path>]"," discipline turn-open <session-id> --campaign-root <path> --owner <seat> --action-class <class>"," --max-duration <minutes> --allowed-command a,b --repo-root a,b --owned-path a,b"," --forbidden-path a,b --verify-command a,b [--requires-human-approval]"," [--projection-policy on_state_change|on_command_only] [--seat-manifest <path>]"," discipline turn-close <session-id> --campaign-root <path> --turn <turn-id>"," --result <done|blocked|handed_off|stopped|timed_out> --summary <text> [--evidence-ref a,b]"," discipline session-command <session-id> <command> --campaign-root <path>"," [--actor <seat>] [--payload <json>] [--seat-manifest <path>]"," discipline session-project <session-id> --campaign-root <path>"," discipline session-rebuild <session-id> --campaign-root <path>"," discipline seat-validate [--manifest <path>]","","usage (memory journal \u2014 local-first, compact-then-exact):"," etiquette memory index [--project <path>] [--db <path>] [--local-private] [--json]"," etiquette memory index --export [<dir>] --org-id <opaque-id> --confirm-shared-export"," [--workspace-id <opaque-id>] [--project <path>] [--db <path>] [--json]"," etiquette memory search <query> [--project <path>] [--db <path>] [--limit <n>] [--json]"," etiquette memory show <capsule-id> [--project <path>] [--db <path>]"," etiquette memory preflight <lane-or-task> [--project <path>] [--db <path>] [--limit <n>] [--json]"," etiquette memory context [<query>] [--lane <ref>] [--task <ref>] [--query <text>]"," [--workspace-id <opaque-id>] [--org-id <opaque-id>] [--project <path>] [--db <path>] [--limit <n>] [--json]"," etiquette memory status [--project <path>] [--db <path>] [--root <path>] [--json]"," etiquette memory store init --store <id> --scope org|workspace|lane|seat|session --access read_only|read_write"," [--mount-mode filesystem_like|context_pack|mcp_resource] [--write-policy none|candidate_only|curator_promoted]"," [--project <path>] [--root <path>] [--at <iso8601>] [--json]"," etiquette memory store add --store <id> --path <repo-relative> --content <text> --evidence <type:ref,...>"," [--project <path>] [--root <path>] [--at <iso8601>] [--json]"," etiquette memory store list [--project <path>] [--root <path>] [--json]"," etiquette memory store show --store <id> [--project <path>] [--root <path>] [--json]"," etiquette memory consolidate --input <store-id,...> --out <store-id> [--project <path>] [--root <path>] [--at <iso8601>] [--json]"," etiquette memory drain-import --from-project <child-path> --from-store <id> --to-store <id>"," [--project <parent-path>] [--from-root <path>] [--to-root <path>] [--source-ref <ref>] [--target-ref <ref>]"," [--path-prefix <repo-relative>] [--receipt <path>] [--at <iso8601>] [--json]"," etiquette memory sharded-drain-import --shard <id=child-path,...> --from-store <id> --to-store <id>"," [--project <parent-path>] [--target-ref <ref>] [--receipt-dir <repo-dir>] [--receipt <path>] [--json]"," etiquette memory stale [--project <path>] [--db <path>] [--limit <n>] [--json]"," etiquette memory rejected [--project <path>] [--db <path>] [--limit <n>] [--json]","","usage (console v0 - read-only local management view):"," etiquette console snapshot [--project <path>] [--json]"," etiquette console board [--project <path>] [--seat <id>] [--text]"," etiquette console serve [--project <path>] [--host 127.0.0.1] [--port 4173]","","usage (local workspace workflow v0 - repo-local onboarding, no hidden authority):"," etiquette setup [--target auto|all|codex|claude-code|gemini] [--project <path>]"," [--dry-run] [--force] [--eject] [--json]"," etiquette handoff [--project <path>] [--profile codex-cc-gemini|lead-review] [--task-prefix <id>] [--json]"," etiquette init [--project <path>]"," etiquette bootstrap local [--project <path>] [--profile codex-cc-gemini|lead-review]"," [--task-prefix <id>] [--lead-seat <id>] [--lead-principal <id>]"," [--review-seat <id>] [--review-principal <id>] [--qa-seat <id>] [--qa-principal <id>]"," [--bootstrap-seat <id>] [--bootstrap-principal <id>] [--no-qa] [--force] [--json]"," etiquette whereami [--project <path>] [--seat <id>] [--task <ref>] [--json]"," etiquette join --seat <id> [--project <path>] [--json]"," etiquette pickup --seat <id> --task <ref> [--project <path>] [--text|--json]"," etiquette enter <task> --seat <id> --operator <principal> [--project <path>]"," etiquette session create --seat <id> --task <ref> [--session-id <id>] [--operator <id>]"," [--owner <id>] [--target-ref <ref>] [--creation-mode explicit|dynamic] [--project <path>] [--json]"," etiquette session note --session <id> --section plan|tool|retry|evidence|note --message <text>"," [--project <path>] [--json]"," etiquette session migrate-project [--project <path>] [--dry-run] [--json]"," etiquette audit append --actor <id> --action <id> [--project <path>] [--refs a,b]"," etiquette roster card validate --card <path>"," etiquette roster enroll <seat> --card <path> --operator-principal <id> --execution-seat <id>"," --as-role <role> --authority-scope <scope> --mode <mode> --orientation-ref <path> [--project <path>]"," etiquette roster ready <seat> --ack-ref <ref> --orientation-ref <path> [--project <path>]"," etiquette roster list|show|posture <seat> [--project <path>] [--json]"," etiquette roster doctor [--project <path>] [--cards <dir>] [--json]"," etiquette post --role <role> --lane <id> --from <seat> --to <seat> [--emit] [--project <path>]"," etiquette notify subscribe --seat <id> --lane <id> [--roles a,b] [--project <path>]"," etiquette notify feed --seat <id> [--project <path>] [--text]"," etiquette notify poll --seat <id> [--project <path>] [--after-seq <n>] [--limit <n>] [--text|--json]"," etiquette notify queue --seat <id> [--project <path>] [--text|--json]"," etiquette notify webhook github --payload <file> --delivery <id> --event push --signature-256 <sha256=...>"," [--secret-env ETIQUETTE_GITHUB_WEBHOOK_SECRET] [--text|--json]"," etiquette return check --task <ref> --seat <id> [--role any|implementation-return|review-return]"," [--tier local-advisory|remote-runner-hard-gate] [--remote-runner] [--project <path>] [--json]"," etiquette retire <path> --reason superseded|rejected|closed|duplicate --evidence-ref <ref>"," --removed-by <seat> [--superseded-by <path>] [--project <path>] [--json]"," etiquette trash list|show|restore|rebuild ... [--project <path>] [--json]"," etiquette rig doctor [--project <path>]"," etiquette bus status [n] [--project <path>] [--text]"," etiquette bus inbox --addressee <seat> [--project <path>] [--text]"," etiquette bus view [--project <path>] [--lane <id>] [--seat <id>] [--role <role>]"," [--since <n|local://event/n>] [--until <n|local://event/n>] [--match <text>]"," [--kind all|events|packets] [--limit <n>] [--format text|json|markdown]"," etiquette timeline view [--project <path>] [--scope project|seat|lane|principal] [--seat <id>] [--lane <id>]"," [--since <n|local://event/n>] [--until <n|local://event/n>] [--match <text>] [--limit <n>]"," [--format text|json|markdown]"," etiquette timeline preview [--project <path>] [--scope project|seat|lane|principal] [--seat <id>] [--lane <id>]"," [--since <n|local://event/n>] [--until <n|local://event/n>] [--match <text>] [--limit <n>]"," [--host 127.0.0.1] [--port 4174] # loopback only"," etiquette diagnostics runner-glitch --symptom <text> [--runner <id>] [--session <id>]"," [--command-ref <summary>] [--severity info|warning|blocked] [--project <path>] [--json]"," etiquette diagnostics no-return --task <ref> --seat <id> [--role any|implementation-return|review-return]"," [--project <path>] [--json]"," etiquette status [--project <path>]","","usage (ledger retrieval v0.1 - local generated index, compact-then-exact):"," etiquette ledger index [--project <path>] [--db <path>] [--json]"," etiquette ledger search <query> [--project <path>] [--db <path>] [--limit <n>] [--json]"," etiquette ledger search --topic <slug> [--project <path>] [--db <path>] [--limit <n>] [--json]"," etiquette ledger show <entry-or-ref-id> [--project <path>] [--db <path>]","","usage (hook adapter v0.1 \u2014 optional, disabled-by-default, opt in via ETIQUETTE_HOOKS_ENABLED=1):"," etiquette hook session_start [--workspace <id>] [--payload <json>]"," etiquette hook user_prompt_submit [--workspace <id>] [--payload <json>]"," etiquette hook post_tool_use [--workspace <id>] [--payload <json>]"," etiquette hook stop [--workspace <id>] [--payload <json>]"," etiquette hook session_end [--workspace <id>] [--payload <json>]","","usage (harness maintenance v0 - pruning receipts, inventory, and canary checks; no deletion authority):"," etiquette harness receipt --receipt <path> [--json]"," etiquette harness inventory --manifest <path> [--project <path>] [--json]"," etiquette harness canary --receipt <path> [--json]","","usage (rubric runner v0.1 - local sandbox evidence, no authority activation):"," etiquette rubric validate --rubric <path> [--json]"," etiquette rubric sandbox --rubric <path> --fixtures <path> --run-by <seat>"," [--environment local|sandbox-isolated] [--at <iso8601>] [--receipt <path>] [--json]"," etiquette rubric promote-check --rubric <path> --receipt <path>"," [--policy <path>] [--grant-ref <ref>] [--json]","","usage (release readiness v0 - package/channel checks, no publish authority):"," etiquette release channels [--json]"," etiquette release readiness [--project <path>] [--json] [--fail-on-blocked]"," etiquette release ga-readiness [--project <path>] --channel <name>"," --verify-tag-remote <remote> [--json] [--fail-on-blocked]","","usage (infra runtime \u2014 source-only, not shipped in the local devkit):"," runtime verifier cells, kube plans, and EKS provisioning belong to an infra/runtime workspace.","","usage (seat capability heartbeat v0.1 - local-first routing metadata):"," etiquette seat readiness --seat <id> [--project <path>] [--state <path>]"," [--seat-type control_seat|execution_seat|review_seat|seat_maintainer]"," [--execution-surface <opaque-id>] [--capability-source config|local_validation|seat_doctor|agent_self_declared]"," [--operational-status operational|degraded|blocked|offline]"," [--model-tier lite_fast|balanced|frontier_high_reasoning|local_unknown] [--model-id <opaque-id>]"," [--active-workers <n>] [--max-recommended-workers <n>] [--supports-parallel true|false]"," [--supported-strategies a,b] [--unsupported-strategies a,b] [--constraints a,b] [--json]"," etiquette seat heartbeat [--project <path>] [--state <path>] [--seat <id>]"," [--operational-status operational|degraded|blocked|offline] [--active-workers <n>] [--constraints a,b] [--json]"," etiquette seat status [--project <path>] [--state <path>] [--json]"," etiquette seat owner-card --manifest <path> [--project <path>] [--state <path>] [--at <iso8601>] [--json]","","usage (workflow mode consumer v0.1 - advisory-only policy preset checks):"," etiquette workflow validate --mode <path> [--json]"," etiquette workflow explain <deliberative|expedient|mixed> [--json]"," etiquette workflow check --mode <path> --task <path> [--json]","","usage (workspace authority v0 - personal-local, org-remote, runtime-cell roots):"," etiquette workspace authority --profile <path> [--json]","","usage (operational dispatch consumer v0 - advisory wiring, no execution):"," etiquette dispatch scaffold [--project <path>] [--task-id <id>] [--seat <id>] [--out <dir>] [--json]"," etiquette dispatch check --mode <path> --task <path> [--project <path>] [--state <path>]"," [--sandbox-receipt <path>] [--strategy <id>] [--at <iso8601>] [--json]"," etiquette dispatch record --mode <path> --task <path> [--project <path>] [--state <path>]"," [--sandbox-receipt <path>] [--strategy <id>] [--at <iso8601>] [--recorded-by <seat>] [--json]"," etiquette dispatch projection --record <path> [--artifact-ref <ref>] [--receipt-ref <repo-ref>]"," [--status success|partial|blocked|failed] [--validation-summary <text>] [--json]","","usage (local-remote sync outbox v0 - local staging only, no network):"," etiquette sync stage [--project <path>] [--outbox <path>] [--workspace-id <opaque-id>]"," [--org-id <opaque-id>] [--seat-id <opaque-id>] [--at <iso8601>] [--json]"," etiquette sync join-plan --invite <path> --joined-by <seat> --claim-ref <ref>"," [--at <iso8601>] [--json]"," etiquette sync git-driver-status [--project <path>] [--driver-name etqseq] [--json]"," etiquette sync install-git-merge-driver [--project <path>] [--driver-name etqseq]"," [--driver-command <command>] [--skip-git-config] [--json]"].join(`
|
|
182
182
|
`)}import{homedir as jH}from"os";import{join as Xe,resolve as sT}from"path";function fr(r){let n=sT(r),t=Xe(n,WH);return{campaignRoot:n,runtimeDir:t,sqlitePath:Xe(t,"supervision.sqlite"),eventsPath:Xe(t,"events.jsonl"),latestStatePath:Xe(t,"latest-state.json"),latestProjectionPath:Xe(t,"latest-projection.json")}}function rS(r){if(r&&r.trim().length>0)return sT(r);return PH}var WH=".etiquette/runtime/supervision",PH;var pn=D(()=>{PH=Xe(jH(),".local","share","etiquette","seat-capabilities.json")});import{readFile as JH}from"fs/promises";function Be(r){return typeof r==="string"}function Jt(r){return typeof r==="boolean"}function AH(r){return Be(r)&&Qe.includes(r)}function kH(r){return Be(r)&&Lg.includes(r)}function vH(r,n){let t=[];if(typeof r!=="object"||r===null||Array.isArray(r))throw new Di("manifest root is not an object",n,[`got ${Array.isArray(r)?"array":typeof r}`]);let e=r,i=[["schemaVersion",(_)=>_==="discipline-supervision-seat-capabilities.v1",'must equal "discipline-supervision-seat-capabilities.v1"'],["seatId",Be,"must be a non-empty string"],["displayName",Be,"must be a string"],["runtimeKind",kH,`must be one of: ${Lg.join(", ")}`],["canReadHandshake",Jt,"must be a boolean"],["canWriteHandshake",Jt,"must be a boolean"],["canReadProductRepo",Jt,"must be a boolean"],["canRunBuilds",Jt,"must be a boolean"],["canWriteProductRepo",Jt,"must be a boolean"],["canLaunchRuntimeTargets",Jt,"must be a boolean"],["canAcceptMobileSteering",Jt,"must be a boolean"],["defaultRequiresHumanApprovalForProductMutation",Jt,"must be a boolean"],["updatedAt",Be,"must be an ISO-8601 string"]];for(let[_,c,o]of i){if(!(_ in e)){t.push(`${_} missing`);continue}if(!c(e[_]))t.push(`${_} invalid (${o})`)}if("seatId"in e&&Be(e.seatId)&&e.seatId.trim().length===0)t.push("seatId must not be empty");if(!("allowedActionClasses"in e))t.push("allowedActionClasses missing");else if(!Array.isArray(e.allowedActionClasses))t.push("allowedActionClasses must be an array");else{let _=e.allowedActionClasses.filter((c)=>!AH(c));if(_.length>0)t.push(`allowedActionClasses contains unknown values: ${_.map(String).join(", ")}`)}if(t.length>0)throw new Di("seat manifest validation failed",n,t);return e}async function At(r){let n=rS(r),t;try{t=await JH(n,"utf-8")}catch(i){throw new Di("seat manifest could not be read",n,[i.code??String(i)])}let e;try{e=JSON.parse(t)}catch(i){throw new Di("seat manifest is not valid JSON",n,[String(i)])}return vH(e,n)}var Di;var kc=D(()=>{FI();pn();Di=class Di extends Error{path;issues;constructor(r,n,t){super(`${r}: ${t.join("; ")}`);this.path=n;this.issues=t;this.name="SeatManifestError"}}});function T4(r,n){let t=new Set(n);return r.every((e)=>t.has(e))}function nS(r){let n=[];if(!Number.isInteger(r.maxDurationMinutes)||r.maxDurationMinutes<=0)n.push("maxDurationMinutes must be a positive integer");switch(r.allowedActionClass){case"coordination_only":{if(!T4(r.allowedCommands,["write_projection","append_evidence"]))n.push("allowedCommands must be a subset of {write_projection, append_evidence}");if(r.repoRoots.length>0)n.push("repoRoots must be empty");if(r.ownedPaths.length>0)n.push("ownedPaths must be empty");if(r.forbiddenPaths.length>0)n.push("forbiddenPaths must be empty");if(r.verifyCommands.length>0)n.push("verifyCommands must be empty");break}case"read_only_local":{if(!T4(r.allowedCommands,["inspect_repo","write_projection","append_evidence"]))n.push("allowedCommands must be a subset of {inspect_repo, write_projection, append_evidence}");if(r.repoRoots.length===0)n.push("repoRoots must be non-empty");if(r.ownedPaths.length>0)n.push("ownedPaths must be empty");if(r.forbiddenPaths.length>0)n.push("forbiddenPaths must be empty");if(r.verifyCommands.length>0)n.push("verifyCommands must be empty");break}case"bounded_verification":{if(!r.allowedCommands.includes("run_verify"))n.push("allowedCommands must include run_verify");if(!T4(r.allowedCommands,["inspect_repo","run_verify","write_projection","append_evidence"]))n.push("allowedCommands may only include {inspect_repo, run_verify, write_projection, append_evidence}");if(r.repoRoots.length===0)n.push("repoRoots must be non-empty");if(r.verifyCommands.length===0)n.push("verifyCommands must be non-empty");if(r.ownedPaths.length>0)n.push("ownedPaths must be empty");break}case"bounded_product_mutation":{if(!r.allowedCommands.includes("write_product_files"))n.push("allowedCommands must include write_product_files");if(r.repoRoots.length===0)n.push("repoRoots must be non-empty");if(r.ownedPaths.length===0)n.push("ownedPaths must be non-empty");if(r.verifyCommands.length===0)n.push("verifyCommands must be non-empty");if(!r.requiresHumanApproval)n.push("requiresHumanApproval must be true for bounded_product_mutation");break}case"human_only":{n.push("human_only turns may not be opened by automation");break}default:n.push(`unknown action class: ${r.allowedActionClass}`)}if(n.length>0)throw new vc(r.allowedActionClass,n)}function tS(r,n){let t=[];if(!n.allowedActionClasses.includes(r.allowedActionClass))t.push(`seat ${n.seatId} does not allow action class ${r.allowedActionClass}`);if(r.allowedCommands.includes("run_verify")&&!n.canRunBuilds)t.push(`seat ${n.seatId} lacks canRunBuilds for run_verify`);if(r.allowedCommands.includes("write_product_files")&&!n.canWriteProductRepo)t.push(`seat ${n.seatId} lacks canWriteProductRepo for write_product_files`);if(r.allowedCommands.includes("launch_runtime_target")&&!n.canLaunchRuntimeTargets)t.push(`seat ${n.seatId} lacks canLaunchRuntimeTargets for launch_runtime_target`);if(r.allowedActionClass==="bounded_product_mutation"&&!r.requiresHumanApproval)t.push("bounded_product_mutation requires requiresHumanApproval=true");if(t.length>0)throw new vc(r.allowedActionClass,t)}function iS(r,n){let t=[],e=(_,c,o)=>{if(_!==c)t.push(`${o}: requested=${String(_)} vs approved=${String(c)}`)},i=(_,c,o)=>{let u=[..._].sort(),$=[...c].sort();if(u.length!==$.length||u.some((g,d)=>g!==$[d]))t.push(`${o}: requested=[${u.join(",")}] vs approved=[${$.join(",")}]`)};return e(r.ownerSeat,n.ownerSeat,"ownerSeat"),e(r.allowedActionClass,n.allowedActionClass,"allowedActionClass"),e(r.maxDurationMinutes,n.maxDurationMinutes,"maxDurationMinutes"),e(r.requiresHumanApproval,n.requiresHumanApproval,"requiresHumanApproval"),e(r.projectionPolicy,n.projectionPolicy,"projectionPolicy"),i(r.allowedCommands,n.allowedCommands,"allowedCommands"),i(r.repoRoots,n.repoRoots,"repoRoots"),i(r.ownedPaths,n.ownedPaths,"ownedPaths"),i(r.forbiddenPaths,n.forbiddenPaths,"forbiddenPaths"),i(r.verifyCommands,n.verifyCommands,"verifyCommands"),{matches:t.length===0,diffs:t}}var vc;var S4=D(()=>{vc=class vc extends Error{actionClass;issues;constructor(r,n){super(`action class ${r} violated: ${n.join("; ")}`);this.actionClass=r;this.issues=n;this.name="ActionClassViolation"}}});import{appendFile as MH,mkdir as FH,readFile as GH}from"fs/promises";import{dirname as VH}from"path";function XH(r){let n={event_id:r.eventId,session_id:r.sessionId,turn_id:r.turnId,command_id:r.commandId,event_type:r.eventType,actor:r.actor,audience:r.audience,at:r.at,payload:r.payload??null};return`${JSON.stringify(n)}
|
|
183
183
|
`}async function Or(r,n){await FH(VH(r),{recursive:!0}),await MH(r,XH(n),"utf-8")}async function Ig(r){let n;try{n=await GH(r,"utf-8")}catch(e){if(e.code==="ENOENT")return[];throw e}return n.split(`
|
|
184
184
|
`).filter((e)=>e.trim().length>0).map((e,i)=>{let _;try{_=JSON.parse(e)}catch(c){throw Error(`events.jsonl line ${i+1} is not valid JSON: ${String(c)}`)}return{eventId:String(_.event_id),sessionId:String(_.session_id),turnId:_.turn_id===null||_.turn_id===void 0?null:String(_.turn_id),commandId:_.command_id===null||_.command_id===void 0?null:String(_.command_id),eventType:_.event_type,actor:String(_.actor),audience:_.audience,at:String(_.at),payload:_.payload}})}function lr(r,n){return{eventId:r.randomId(),sessionId:n.sessionId,turnId:n.turnId,commandId:n.commandId,eventType:n.eventType,actor:n.actor,audience:n.audience,at:n.at,payload:n.payload}}var $t=()=>{};function pr(r){r.run(`
|
package/docs/CONCEPTS.md
CHANGED
|
@@ -113,7 +113,7 @@ External tools keep their native jobs: chat is conversation, planning tools are
|
|
|
113
113
|
planning, code hosts are review, observability is incident evidence, and
|
|
114
114
|
identity systems are identity.
|
|
115
115
|
|
|
116
|
-
Etiquette is the accountability
|
|
116
|
+
Etiquette is the accountability journal. External "Done" is not acceptance.
|
|
117
117
|
Authentication is not authorization.
|
|
118
118
|
|
|
119
119
|
## Short Rules
|
|
@@ -126,3 +126,4 @@ Portals display and coordinate.
|
|
|
126
126
|
Integrations project refs.
|
|
127
127
|
Execution returns evidence; it never mints authority.
|
|
128
128
|
```
|
|
129
|
+
|
package/docs/README.md
CHANGED
|
@@ -19,7 +19,7 @@ maintainers. They are not part of the local devkit tarball.
|
|
|
19
19
|
Integration profile:
|
|
20
20
|
Slack/Teams are conversation, Jira/Linear are planning, GitHub/GitLab are code
|
|
21
21
|
review, Sentry/Datadog/OpenTelemetry are incident evidence, and SSO/SCIM/OIDC
|
|
22
|
-
are identity. Etiquette is the accountability
|
|
22
|
+
are identity. Etiquette is the accountability journal: chat is not source of
|
|
23
23
|
truth, external Done is not acceptance, and authentication is not authorization.
|
|
24
24
|
|
|
25
25
|
Current release posture: Core is the default local-first product, Exec is
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Ledger Entry Contracts
|
|
2
2
|
|
|
3
|
-
This contract keeps the ledger-query-mode work narrow. It hardens the
|
|
4
|
-
typed ledger entries that later
|
|
3
|
+
This contract keeps the ledger-query-mode work narrow. It hardens the journal first:
|
|
4
|
+
typed ledger entries that later working-loop queries can read without guessing.
|
|
5
5
|
|
|
6
6
|
It does not ship a ledger query engine, sabbatical dossier engine, capsule
|
|
7
7
|
promotion loop, or remote ledger authority.
|
|
@@ -10,7 +10,7 @@ promotion loop, or remote ledger authority.
|
|
|
10
10
|
|
|
11
11
|
```text
|
|
12
12
|
raw local ledger entry
|
|
13
|
-
-> typed
|
|
13
|
+
-> typed `spine_eligible` metadata
|
|
14
14
|
-> optional compact projection
|
|
15
15
|
-> later sabbatical capsule only after operator promotion
|
|
16
16
|
```
|
|
@@ -18,12 +18,12 @@ raw local ledger entry
|
|
|
18
18
|
## Core Rule
|
|
19
19
|
|
|
20
20
|
```text
|
|
21
|
-
|
|
21
|
+
The working loop routes the present.
|
|
22
22
|
Sabbatical understands the arc.
|
|
23
|
-
Capsules compress the arc back into
|
|
23
|
+
Capsules compress the arc back into working-loop context.
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
The
|
|
26
|
+
The planner may recommend. The journal may route. Grants authorize. Execution
|
|
27
27
|
mutates. Receipts prove. Audit accounts.
|
|
28
28
|
|
|
29
29
|
## Contracts
|
|
@@ -65,18 +65,18 @@ These names are reserved vocabulary, not V0 machinery:
|
|
|
65
65
|
search adapters; SQLite FTS5 is the only V0.1 retrieval accelerator.
|
|
66
66
|
- `ledger-topic-dossier.v0` — unlock only when an operator asks for a durable
|
|
67
67
|
long-horizon dossier over a real topic.
|
|
68
|
-
- `sabbatical-ledger-query` — reserved as the deliberate
|
|
69
|
-
cannot write the
|
|
70
|
-
- `capsule-to-
|
|
68
|
+
- `sabbatical-ledger-query` — reserved as the deliberate planner posture; it
|
|
69
|
+
cannot write the working journal directly.
|
|
70
|
+
- `capsule-to-journal-feedback` — unlock only when reviewed capsules have a human
|
|
71
71
|
promotion surface.
|
|
72
72
|
|
|
73
73
|
Deferred surfaces must name an operational consumer before implementation.
|
|
74
74
|
|
|
75
75
|
## Boundary
|
|
76
76
|
|
|
77
|
-
- The
|
|
77
|
+
- The planner cannot write the journal directly. It may produce a capsule or
|
|
78
78
|
dossier that an operator later promotes.
|
|
79
|
-
- `spine_eligible: true` is explicit;
|
|
79
|
+
- `spine_eligible: true` is explicit; working-loop indexes do not infer eligibility
|
|
80
80
|
from entry type.
|
|
81
81
|
- Existing ledger lines remain readable as `pre_v0: true` legacy entries.
|
|
82
82
|
- Ledger entries do not authorize work unless a valid grant path says so.
|
|
@@ -9,7 +9,7 @@ does not authorize work, attach grants, close tasks, or replace receipts.
|
|
|
9
9
|
|
|
10
10
|
```text
|
|
11
11
|
The leading timestamp (created_at) is the RECORDING time. It is never
|
|
12
|
-
backdated. If work was done off the
|
|
12
|
+
backdated. If work was done off the journal, it is reconciled with a late
|
|
13
13
|
entry recorded at its true time, pointing at contemporaneous evidence.
|
|
14
14
|
Synthesizing entries with past recording times is corruption, not repair:
|
|
15
15
|
one plausible fake timestamp devalues every real one.
|
|
@@ -51,7 +51,7 @@ valid_time_end:
|
|
|
51
51
|
## Added Entry Type
|
|
52
52
|
|
|
53
53
|
`entry_type: retroactive_import` — a late reconciliation entry covering work
|
|
54
|
-
that was executed without contemporaneous
|
|
54
|
+
that was executed without contemporaneous journal entries. Rules, enforced by
|
|
55
55
|
the validator:
|
|
56
56
|
|
|
57
57
|
- requires schema `ledger-entry.v0.2` (rejected on v0/v0.1);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# ledger-entry.v0
|
|
2
2
|
|
|
3
|
-
`ledger-entry.v0` is the typed local ledger record used by the
|
|
3
|
+
`ledger-entry.v0` is the typed local ledger record used by the working journal.
|
|
4
4
|
It makes compact ledger lines structurally queryable without promoting the
|
|
5
5
|
ledger into an authority source.
|
|
6
6
|
|
|
@@ -58,7 +58,7 @@ legacy:
|
|
|
58
58
|
`authority.class: grant` may set it to `true`, and only when the entry carries
|
|
59
59
|
the durable grant reference required by the local workflow.
|
|
60
60
|
|
|
61
|
-
`spine_eligible` is explicit. A
|
|
61
|
+
`spine_eligible` is explicit. A working-loop index must not infer it from
|
|
62
62
|
`entry_type`. Entries that are useful for current-state routing should set it to
|
|
63
63
|
`true`; archival, noisy, or unreviewed entries should set it to `false`.
|
|
64
64
|
|
|
@@ -92,17 +92,17 @@ legacy:
|
|
|
92
92
|
spine_eligible: false
|
|
93
93
|
```
|
|
94
94
|
|
|
95
|
-
##
|
|
95
|
+
## Journal And Planner Boundary
|
|
96
96
|
|
|
97
97
|
```text
|
|
98
|
-
|
|
98
|
+
The working loop routes the present.
|
|
99
99
|
Sabbatical understands the arc.
|
|
100
|
-
Capsules compress the arc back into
|
|
100
|
+
Capsules compress the arc back into working-loop context.
|
|
101
101
|
```
|
|
102
102
|
|
|
103
|
-
The
|
|
104
|
-
capsule or dossier, but it cannot write back into the
|
|
105
|
-
from capsule to
|
|
103
|
+
The working journal reads typed ledger entries. The sabbatical planner may produce a
|
|
104
|
+
capsule or dossier, but it cannot write back into the journal directly. Promotion
|
|
105
|
+
from capsule to journal requires an explicit operator gate.
|
|
106
106
|
|
|
107
107
|
## Authority Boundary
|
|
108
108
|
|