@intentius/chant 0.100.0 → 0.101.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/dist/build.d.ts +6 -0
- package/dist/build.d.ts.map +1 -1
- package/dist/cli/build-options.d.ts +2 -0
- package/dist/cli/build-options.d.ts.map +1 -1
- package/dist/cli/commands/build.d.ts.map +1 -1
- package/dist/cli/commands/import.d.ts.map +1 -1
- package/dist/cli/handlers/fan-out.d.ts.map +1 -1
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/mcp/workspace-tools.d.ts +8 -0
- package/dist/cli/mcp/workspace-tools.d.ts.map +1 -1
- package/dist/cli/registry.d.ts +22 -0
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/config.d.ts +11 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/lexicon.d.ts +24 -1
- package/dist/lexicon.d.ts.map +1 -1
- package/dist/lifecycle/gate-ledger.d.ts.map +1 -1
- package/dist/lifecycle/plan-digest.d.ts +26 -5
- package/dist/lifecycle/plan-digest.d.ts.map +1 -1
- package/dist/lint/config.d.ts +4 -4
- package/dist/op/activities/activity-contracts.d.ts +1 -0
- package/dist/op/activities/activity-contracts.d.ts.map +1 -1
- package/dist/op/activities/propose-upgrade.d.ts +2 -0
- package/dist/op/activities/propose-upgrade.d.ts.map +1 -1
- package/dist/op/index.d.ts +1 -1
- package/dist/op/index.d.ts.map +1 -1
- package/dist/serializer.d.ts +8 -0
- package/dist/serializer.d.ts.map +1 -1
- package/dist/telemetry-attribution.d.ts +77 -0
- package/dist/telemetry-attribution.d.ts.map +1 -0
- package/dist/workspace/agent-cli.d.ts +83 -0
- package/dist/workspace/agent-cli.d.ts.map +1 -0
- package/dist/workspace/changes-cli.d.ts.map +1 -1
- package/dist/workspace/changes.d.ts +8 -1
- package/dist/workspace/changes.d.ts.map +1 -1
- package/dist/workspace/checks/links.d.ts +1 -0
- package/dist/workspace/checks/links.d.ts.map +1 -1
- package/dist/workspace/checks/live.d.ts +40 -0
- package/dist/workspace/checks/live.d.ts.map +1 -0
- package/dist/workspace/checks.d.ts +21 -2
- package/dist/workspace/checks.d.ts.map +1 -1
- package/dist/workspace/compose-graph.d.ts +63 -0
- package/dist/workspace/compose-graph.d.ts.map +1 -1
- package/dist/workspace/decide.d.ts +1 -1
- package/dist/workspace/decide.d.ts.map +1 -1
- package/dist/workspace/declaration.d.ts +32 -0
- package/dist/workspace/declaration.d.ts.map +1 -1
- package/dist/workspace/declaration.schema.json +138 -3
- package/dist/workspace/export-cli.d.ts +12 -0
- package/dist/workspace/export-cli.d.ts.map +1 -0
- package/dist/workspace/export.d.ts +145 -0
- package/dist/workspace/export.d.ts.map +1 -0
- package/dist/workspace/graph-cli.d.ts.map +1 -1
- package/dist/workspace/import.d.ts +73 -0
- package/dist/workspace/import.d.ts.map +1 -0
- package/dist/workspace/kinds.d.ts +6 -2
- package/dist/workspace/kinds.d.ts.map +1 -1
- package/dist/workspace/lineage-adopt-cli.d.ts +15 -0
- package/dist/workspace/lineage-adopt-cli.d.ts.map +1 -0
- package/dist/workspace/lineage-adopt.d.ts +106 -0
- package/dist/workspace/lineage-adopt.d.ts.map +1 -0
- package/dist/workspace/lineage-check.d.ts +9 -2
- package/dist/workspace/lineage-check.d.ts.map +1 -1
- package/dist/workspace/lineage-cli.d.ts +6 -1
- package/dist/workspace/lineage-cli.d.ts.map +1 -1
- package/dist/workspace/lineage-hash-index.d.ts +110 -0
- package/dist/workspace/lineage-hash-index.d.ts.map +1 -0
- package/dist/workspace/lineage-init.d.ts +10 -0
- package/dist/workspace/lineage-init.d.ts.map +1 -1
- package/dist/workspace/lineage-lock.d.ts +147 -0
- package/dist/workspace/lineage-lock.d.ts.map +1 -1
- package/dist/workspace/lineage-migrations.d.ts +15 -3
- package/dist/workspace/lineage-migrations.d.ts.map +1 -1
- package/dist/workspace/lineage-provenance.d.ts +18 -0
- package/dist/workspace/lineage-provenance.d.ts.map +1 -0
- package/dist/workspace/lineage-upgrade-cli.d.ts +2 -0
- package/dist/workspace/lineage-upgrade-cli.d.ts.map +1 -1
- package/dist/workspace/lineage-upgrade.d.ts +30 -1
- package/dist/workspace/lineage-upgrade.d.ts.map +1 -1
- package/dist/workspace/lineage-versions.d.ts +116 -0
- package/dist/workspace/lineage-versions.d.ts.map +1 -0
- package/dist/workspace/links.d.ts +31 -5
- package/dist/workspace/links.d.ts.map +1 -1
- package/dist/workspace/ls-generated.d.ts +37 -0
- package/dist/workspace/ls-generated.d.ts.map +1 -0
- package/dist/workspace/ls.d.ts +4 -0
- package/dist/workspace/ls.d.ts.map +1 -1
- package/dist/workspace/member-commands.d.ts.map +1 -1
- package/dist/workspace/nested-graph.d.ts +56 -0
- package/dist/workspace/nested-graph.d.ts.map +1 -0
- package/dist/workspace/nesting.d.ts +21 -0
- package/dist/workspace/nesting.d.ts.map +1 -0
- package/dist/workspace/pin-cli.d.ts +10 -0
- package/dist/workspace/pin-cli.d.ts.map +1 -0
- package/dist/workspace/pin-integrity.d.ts +51 -0
- package/dist/workspace/pin-integrity.d.ts.map +1 -0
- package/dist/workspace/reason-codes.d.ts +26 -2
- package/dist/workspace/reason-codes.d.ts.map +1 -1
- package/dist/workspace/record-sessions.d.ts +7 -11
- package/dist/workspace/record-sessions.d.ts.map +1 -1
- package/dist/workspace/records-cli.d.ts +30 -1
- package/dist/workspace/records-cli.d.ts.map +1 -1
- package/dist/workspace/records-close.d.ts +5 -2
- package/dist/workspace/records-close.d.ts.map +1 -1
- package/dist/workspace/records-write.d.ts +22 -4
- package/dist/workspace/records-write.d.ts.map +1 -1
- package/dist/workspace/records.d.ts +43 -5
- package/dist/workspace/records.d.ts.map +1 -1
- package/dist/workspace/returns.d.ts +129 -0
- package/dist/workspace/returns.d.ts.map +1 -0
- package/dist/workspace/status-gates.d.ts.map +1 -1
- package/dist/workspace/template-manifest.d.ts +11 -3
- package/dist/workspace/template-manifest.d.ts.map +1 -1
- package/dist/workspace/trust/attestor.d.ts +8 -0
- package/dist/workspace/trust/attestor.d.ts.map +1 -1
- package/dist/workspace/trust/dsse.d.ts +58 -0
- package/dist/workspace/trust/dsse.d.ts.map +1 -0
- package/dist/workspace/trust/evidence-cli.d.ts +66 -0
- package/dist/workspace/trust/evidence-cli.d.ts.map +1 -0
- package/dist/workspace/trust/evidence.d.ts +93 -0
- package/dist/workspace/trust/evidence.d.ts.map +1 -0
- package/dist/workspace/trust/policy.d.ts +54 -1
- package/dist/workspace/trust/policy.d.ts.map +1 -1
- package/dist/workspace/trust/provenance.d.ts +21 -1
- package/dist/workspace/trust/provenance.d.ts.map +1 -1
- package/dist/workspace/trust/rotation.d.ts +132 -0
- package/dist/workspace/trust/rotation.d.ts.map +1 -0
- package/dist/workspace/trust/seal.d.ts.map +1 -1
- package/dist/workspace/trust/signers-cli.d.ts +49 -0
- package/dist/workspace/trust/signers-cli.d.ts.map +1 -0
- package/dist/workspace/trust/ssh-commit.d.ts +12 -0
- package/dist/workspace/trust/ssh-commit.d.ts.map +1 -1
- package/dist/workspace/trust/test-repo.d.ts +13 -0
- package/dist/workspace/trust/test-repo.d.ts.map +1 -1
- package/dist/workspace/trust/verify.d.ts +15 -0
- package/dist/workspace/trust/verify.d.ts.map +1 -1
- package/dist/workspace/work-evidence.d.ts +1 -1
- package/dist/workspace/work-evidence.d.ts.map +1 -1
- package/dist/workspace/write-scope.d.ts +199 -0
- package/dist/workspace/write-scope.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/build.ts +8 -0
- package/src/cli/build-options.ts +4 -1
- package/src/cli/commands/build.ts +2 -0
- package/src/cli/commands/import-live.test.ts +69 -1
- package/src/cli/commands/import.ts +48 -22
- package/src/cli/handlers/fan-out.test.ts +6 -6
- package/src/cli/handlers/fan-out.ts +2 -1
- package/src/cli/handlers/graph.test.ts +42 -0
- package/src/cli/handlers/graph.ts +22 -0
- package/src/cli/handlers/operator.ts +1 -1
- package/src/cli/main.test.ts +32 -0
- package/src/cli/main.ts +103 -6
- package/src/cli/mcp/workspace-tools.test.ts +1 -1
- package/src/cli/mcp/workspace-tools.ts +33 -2
- package/src/cli/registry.ts +22 -0
- package/src/cli/serve-mcp-workspace.test.ts +1 -1
- package/src/codegen/release-wiring.test.ts +5 -1
- package/src/components/fan-out-output.test.ts +1 -1
- package/src/components/fan-out.test.ts +1 -1
- package/src/components/promote.test.ts +1 -1
- package/src/config.ts +12 -0
- package/src/content-digest.test.ts +2 -2
- package/src/lexicon.ts +25 -1
- package/src/lifecycle/gate-ledger.test.ts +14 -0
- package/src/lifecycle/gate-ledger.ts +2 -1
- package/src/lifecycle/plan-digest.test.ts +54 -3
- package/src/lifecycle/plan-digest.ts +38 -8
- package/src/op/activities/activity-contracts.ts +1 -0
- package/src/op/activities/propose-upgrade.ts +8 -5
- package/src/op/gate-approval.test.ts +17 -0
- package/src/op/gate.ts +3 -3
- package/src/op/index.ts +1 -1
- package/src/serializer.ts +9 -0
- package/src/telemetry-attribution.test.ts +91 -0
- package/src/telemetry-attribution.ts +145 -0
- package/src/workspace/agent-cli.ts +134 -0
- package/src/workspace/agent.schema.json +356 -0
- package/src/workspace/behold-kinds.test.ts +1 -1
- package/src/workspace/changes-cli.ts +5 -0
- package/src/workspace/changes.schema.json +179 -1
- package/src/workspace/changes.ts +58 -4
- package/src/workspace/check-live.test.ts +192 -0
- package/src/workspace/check.schema.json +64 -0
- package/src/workspace/checks/links.ts +23 -2
- package/src/workspace/checks/live.ts +113 -0
- package/src/workspace/checks.test.ts +2 -2
- package/src/workspace/checks.ts +20 -3
- package/src/workspace/compose-graph.test.ts +47 -0
- package/src/workspace/compose-graph.ts +120 -3
- package/src/workspace/conformance/__fixture__/decisions/decision.kind.mjs +7 -1
- package/src/workspace/conformance/__fixture__/decisions/decision.schema.json +5 -0
- package/src/workspace/declaration.schema.json +138 -3
- package/src/workspace/declaration.ts +106 -1
- package/src/workspace/declared-kinds.test.ts +33 -0
- package/src/workspace/evidence.schema.json +279 -0
- package/src/workspace/export-cli.ts +180 -0
- package/src/workspace/export-import.test.ts +282 -0
- package/src/workspace/export.ts +486 -0
- package/src/workspace/graph-cli.ts +47 -1
- package/src/workspace/graph-contract.test.ts +89 -4
- package/src/workspace/graph.schema.json +206 -1
- package/src/workspace/import.ts +325 -0
- package/src/workspace/kinds.test.ts +5 -5
- package/src/workspace/kinds.ts +25 -3
- package/src/workspace/lineage-adopt-cli.ts +103 -0
- package/src/workspace/lineage-adopt.test.ts +552 -0
- package/src/workspace/lineage-adopt.ts +452 -0
- package/src/workspace/lineage-check.ts +26 -5
- package/src/workspace/lineage-cli.ts +12 -2
- package/src/workspace/lineage-hash-index.ts +305 -0
- package/src/workspace/lineage-init.test.ts +9 -0
- package/src/workspace/lineage-init.ts +29 -9
- package/src/workspace/lineage-lock.ts +54 -0
- package/src/workspace/lineage-migrations.test.ts +27 -0
- package/src/workspace/lineage-migrations.ts +44 -14
- package/src/workspace/lineage-provenance.ts +40 -0
- package/src/workspace/lineage-upgrade-cli.ts +9 -5
- package/src/workspace/lineage-upgrade.test.ts +92 -1
- package/src/workspace/lineage-upgrade.ts +111 -16
- package/src/workspace/lineage-versions.ts +348 -0
- package/src/workspace/links.test.ts +121 -2
- package/src/workspace/links.ts +97 -6
- package/src/workspace/ls-contract.test.ts +84 -1
- package/src/workspace/ls-generated.ts +111 -0
- package/src/workspace/ls.schema.json +19 -0
- package/src/workspace/ls.ts +8 -1
- package/src/workspace/member-commands.ts +3 -1
- package/src/workspace/nested-graph.test.ts +176 -0
- package/src/workspace/nested-graph.ts +169 -0
- package/src/workspace/nesting.ts +37 -0
- package/src/workspace/pin-cli.test.ts +71 -0
- package/src/workspace/pin-cli.ts +57 -0
- package/src/workspace/pin-integrity.test.ts +121 -0
- package/src/workspace/pin-integrity.ts +104 -0
- package/src/workspace/points-write.schema.json +1 -0
- package/src/workspace/read-contract.test.ts +24 -0
- package/src/workspace/reason-codes.test.ts +10 -0
- package/src/workspace/reason-codes.ts +29 -2
- package/src/workspace/record-sessions.ts +12 -14
- package/src/workspace/records-amend.schema.json +4 -0
- package/src/workspace/records-cli.ts +93 -12
- package/src/workspace/records-close.schema.json +6 -2
- package/src/workspace/records-close.ts +10 -2
- package/src/workspace/records-formats.test.ts +13 -5
- package/src/workspace/records-new.schema.json +4 -0
- package/src/workspace/records-review.schema.json +4 -0
- package/src/workspace/records-sessions.test.ts +23 -6
- package/src/workspace/records-write.test.ts +65 -8
- package/src/workspace/records-write.ts +70 -6
- package/src/workspace/records.schema.json +55 -3
- package/src/workspace/records.ts +96 -5
- package/src/workspace/returns.ts +328 -0
- package/src/workspace/signers.schema.json +206 -0
- package/src/workspace/status-gates.ts +2 -1
- package/src/workspace/template-manifest.ts +22 -4
- package/src/workspace/trust/attestor.ts +15 -0
- package/src/workspace/trust/dsse.ts +134 -0
- package/src/workspace/trust/evidence-cli.ts +195 -0
- package/src/workspace/trust/evidence.test.ts +241 -0
- package/src/workspace/trust/evidence.ts +207 -0
- package/src/workspace/trust/policy.ts +110 -3
- package/src/workspace/trust/provenance.ts +41 -4
- package/src/workspace/trust/record-seal.test.ts +1 -1
- package/src/workspace/trust/rotation.test.ts +258 -0
- package/src/workspace/trust/rotation.ts +336 -0
- package/src/workspace/trust/seal.ts +11 -0
- package/src/workspace/trust/signers-cli.ts +178 -0
- package/src/workspace/trust/ssh-commit.ts +53 -4
- package/src/workspace/trust/test-repo.ts +18 -0
- package/src/workspace/trust/trust.test.ts +8 -2
- package/src/workspace/trust/verify-cli.ts +1 -0
- package/src/workspace/trust/verify.ts +22 -0
- package/src/workspace/work-evidence.schema.json +4 -0
- package/src/workspace/write-scope.test.ts +340 -0
- package/src/workspace/write-scope.ts +448 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reason-codes.d.ts","sourceRoot":"","sources":["../../src/workspace/reason-codes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,sHAAsH;AACtH,eAAO,MAAM,qBAAqB,IAAI,CAAC;AAEvC,uHAAuH;AACvH,eAAO,MAAM,mBAAmB,WAAW,CAAC;AAE5C,qFAAqF;AACrF,eAAO,MAAM,OAAO
|
|
1
|
+
{"version":3,"file":"reason-codes.d.ts","sourceRoot":"","sources":["../../src/workspace/reason-codes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,sHAAsH;AACtH,eAAO,MAAM,qBAAqB,IAAI,CAAC;AAEvC,uHAAuH;AACvH,eAAO,MAAM,mBAAmB,WAAW,CAAC;AAE5C,qFAAqF;AACrF,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4NV,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,OAAO,CAAC;AAE9C,mDAAmD;AACnD,eAAO,MAAM,YAAY,EAA2B,UAAU,EAAE,CAAC;AAEjE,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,UAAU,CAEhE;AAED;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG,UAAU,MAAM,IAAI,MAAM,EAAE,CAAC;AAEtD,eAAO,MAAM,WAAW,QAAkD,CAAC;AAE3E,2HAA2H;AAC3H,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,KAAK,IAAI,UAAU,CAI/E"}
|
|
@@ -26,18 +26,14 @@ export interface SessionCitation {
|
|
|
26
26
|
verdict: string | null;
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
|
-
* The seal of a session record: {@link
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* `awk 'NR==1&&/^---$/{f=1;print;next} f&&/^---$/{f=0} f&&/^closed_digest:/{next} {print}' S-0001.md | shasum -a 256`
|
|
36
|
-
* gives the same value for a file with LF line endings that ends in one.
|
|
37
|
-
* For a session kind of format json (ws-053), the seal member is removed by
|
|
38
|
-
* the JSON rule of {@link recordTextDigest} instead.
|
|
29
|
+
* The seal of a session record: {@link recordSeal} with the seal field, the
|
|
30
|
+
* whole-file JCS/SHA-256 every closed record of a sealed kind carries
|
|
31
|
+
* (#2546, ws-063). Until #2546 it was the SHA-256 of the file's text without
|
|
32
|
+
* the seal line; a session sealed by that rule holds a bare hex value and
|
|
33
|
+
* reads as `session-seal-mismatch` now. Null when the front matter can't be
|
|
34
|
+
* parsed.
|
|
39
35
|
*/
|
|
40
|
-
export declare function sessionSeal(text: string, field: string, format?: RecordFormat): string;
|
|
36
|
+
export declare function sessionSeal(text: string, field: string, format?: RecordFormat): string | null;
|
|
41
37
|
/**
|
|
42
38
|
* Check each session in `entries` against its seal and the subject records,
|
|
43
39
|
* and fill in `citedBy`. `texts` holds each entry's file text by path.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record-sessions.d.ts","sourceRoot":"","sources":["../../src/workspace/record-sessions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"record-sessions.d.ts","sourceRoot":"","sources":["../../src/workspace/record-sessions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAc,KAAK,WAAW,EAAE,KAAK,YAAY,EAAE,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC;AAE7F,mFAAmF;AACnF,MAAM,WAAW,eAAe;IAC9B,+BAA+B;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,2DAA2D;IAC3D,IAAI,EAAE,MAAM,CAAC;IACb,kEAAkE;IAClE,KAAK,EAAE,MAAM,CAAC;IACd,uEAAuE;IACvE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,sEAAsE;IACtE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,GAAE,YAAsC,GAAG,MAAM,GAAG,IAAI,CAEtH;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE;IAAE,OAAO,EAAE,WAAW,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,GAAG,IAAI,CAsDrK"}
|
|
@@ -25,7 +25,7 @@ import { type WorkspaceTree } from "./tree.js";
|
|
|
25
25
|
import type { DecisionWork } from "./work.js";
|
|
26
26
|
import { type ProvenanceLevel } from "./trust/attestor.js";
|
|
27
27
|
import { type BaseSource, type RecordProvenance } from "./trust/provenance.js";
|
|
28
|
-
import type
|
|
28
|
+
import { type TrustPolicy } from "./trust/policy.js";
|
|
29
29
|
/** The version of the `records` output this chant writes. */
|
|
30
30
|
export declare const RECORDS_CONTRACT_VERSION = 1;
|
|
31
31
|
/** `$id` of the JSON Schema for the `--json` output, shipped beside this file. */
|
|
@@ -99,6 +99,7 @@ export type RecordsDocument = {
|
|
|
99
99
|
schema: string;
|
|
100
100
|
file: string;
|
|
101
101
|
format: RecordFormat;
|
|
102
|
+
spec: boolean;
|
|
102
103
|
};
|
|
103
104
|
at: string | null;
|
|
104
105
|
/** The directory pinned paths resolve in, from the repository root: the workspace holding the kind file, or the repository root (#2549). */
|
|
@@ -142,7 +143,35 @@ export interface RecordsSetDocument {
|
|
|
142
143
|
kinds: (RecordsDocument & {
|
|
143
144
|
declared: DeclaredKindView;
|
|
144
145
|
})[];
|
|
146
|
+
/** With `--current`: the workspace's spec (#2524 D20, #2546), from the kinds marked `spec: true`. */
|
|
147
|
+
spec?: SpecView;
|
|
145
148
|
}
|
|
149
|
+
/**
|
|
150
|
+
* The spec (#2524 D20): the current records of every declared kind marked
|
|
151
|
+
* `spec: true`, each with the workspace files it pins. `records --current
|
|
152
|
+
* --json` prints it beside the kinds, so an agent resumes from the
|
|
153
|
+
* declaration and this one read.
|
|
154
|
+
*/
|
|
155
|
+
export interface SpecView {
|
|
156
|
+
/** The spec kinds, as the declaration names them, in its order. */
|
|
157
|
+
kinds: DeclaredKindView[];
|
|
158
|
+
records: SpecRecord[];
|
|
159
|
+
}
|
|
160
|
+
/** One current record of a spec kind. */
|
|
161
|
+
export interface SpecRecord {
|
|
162
|
+
/** The kind's name, such as decision. */
|
|
163
|
+
kind: string;
|
|
164
|
+
id: string | null;
|
|
165
|
+
path: string;
|
|
166
|
+
state: string | null;
|
|
167
|
+
valid: boolean;
|
|
168
|
+
/** The digest a verdict names (#2672). */
|
|
169
|
+
digest: string;
|
|
170
|
+
/** Each workspace file the record pins: its path from the workspace root, the sha256 pinned, and how it compares with the tree read (#2549). */
|
|
171
|
+
assets: RecordEntry["assets"];
|
|
172
|
+
}
|
|
173
|
+
/** The spec of a set of declared kinds already read with `--current`. */
|
|
174
|
+
export declare function specOf(kinds: RecordsSetDocument["kinds"]): SpecView;
|
|
146
175
|
/**
|
|
147
176
|
* The record kinds the declaration nearest above `cwd` names, in the tree
|
|
148
177
|
* `at` reads, with each kind file on disk. Empty when there is no declaration.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"records-cli.d.ts","sourceRoot":"","sources":["../../src/workspace/records-cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAMH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGtD,OAAO,EAAkB,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAkE,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpH,OAAO,EA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ACxF,wBAAgB,aAAa,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE,QAAQ,EAAE,eAAe,GAAG,UAAU,EAAE,CAE5F;AAoCD,yCAAyC;AACzC,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAS9E"}
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
* session in one write. It sets the session's state to its kind's closed
|
|
4
4
|
* state, the time it closed and the commit it closed at (the fields the
|
|
5
5
|
* kind's `session` block names in `closedOn` and `closedRev`), and then the
|
|
6
|
-
* seal by chant's rule ({@link sessionSeal}), so a UI never
|
|
6
|
+
* seal by chant's whole-file rule ({@link sessionSeal}, #2546), so a UI never
|
|
7
|
+
* computes a seal.
|
|
7
8
|
*
|
|
8
9
|
* Like `new`, `amend` and `review`, it reads the records again with the file
|
|
9
10
|
* in place and writes only when the session comes back valid: a verdict
|
|
@@ -14,7 +15,7 @@
|
|
|
14
15
|
import { type WriteFailure, type WriteResult } from "./records-write.js";
|
|
15
16
|
export declare const RECORDS_CLOSE_SCHEMA_ID = "https://intentius.io/chant/schemas/workspace/records-close/v1/records-close.schema.json";
|
|
16
17
|
/** Why `records close` wrote nothing. Closed. */
|
|
17
|
-
export declare const CLOSE_ERROR_CODES: readonly ["kind-unreadable", "kind-invalid", "schema-unreadable", "schema-id-mismatch", "schema-invalid", "location-missing", "write-usage-invalid", "record-not-found", "record-closed", "record-unparseable", "record-schema-invalid", "record-id-duplicate", "record-supersedes-unknown", "record-supersedes-conflict", "record-remediates-unknown", "record-remediates-not-closed", "session-seal-mismatch", "session-verdict-unknown-record"];
|
|
18
|
+
export declare const CLOSE_ERROR_CODES: readonly ["kind-unreadable", "kind-invalid", "schema-unreadable", "schema-id-mismatch", "schema-invalid", "location-missing", "write-usage-invalid", "record-not-found", "record-closed", "write-scope-member", "write-scope-kind", "agent-unknown", "record-unparseable", "record-schema-invalid", "record-id-duplicate", "record-supersedes-unknown", "record-supersedes-conflict", "record-remediates-unknown", "record-remediates-not-closed", "record-seal-mismatch", "session-seal-mismatch", "session-verdict-unknown-record"];
|
|
18
19
|
export type CloseErrorCode = (typeof CLOSE_ERROR_CODES)[number];
|
|
19
20
|
export type CloseDocument = (WriteResult & {
|
|
20
21
|
/** The top-level fields the close set, in the order written. */
|
|
@@ -35,6 +36,8 @@ export interface CloseRecordOptions {
|
|
|
35
36
|
cwd: string;
|
|
36
37
|
/** The close time. Defaults to now. */
|
|
37
38
|
now?: Date;
|
|
39
|
+
/** The agent session the write is made in (#2548). */
|
|
40
|
+
agent?: string;
|
|
38
41
|
}
|
|
39
42
|
/** `records close`: close one open session and seal it. */
|
|
40
43
|
export declare function closeRecord(opts: CloseRecordOptions): Promise<CloseDocument>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"records-close.d.ts","sourceRoot":"","sources":["../../src/workspace/records-close.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"records-close.d.ts","sourceRoot":"","sources":["../../src/workspace/records-close.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAMH,OAAO,EAcL,KAAK,YAAY,EACjB,KAAK,WAAW,EACjB,MAAM,iBAAiB,CAAC;AAIzB,eAAO,MAAM,uBAAuB,4FAA4F,CAAC;AAEjI,iDAAiD;AACjD,eAAO,MAAM,iBAAiB,ugBAOY,CAAC;AAC3C,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhE,MAAM,MAAM,aAAa,GACrB,CAAC,WAAW,GAAG;IACb,gEAAgE;IAChE,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,mDAAmD;IACnD,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACxC,0FAA0F;IAC1F,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B,CAAC,GACF,YAAY,CAAC,cAAc,CAAC,CAAC;AAEjC,MAAM,WAAW,kBAAkB;IACjC,qDAAqD;IACrD,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,uCAAuC;IACvC,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,sDAAsD;IACtD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAOD,2DAA2D;AAC3D,wBAAsB,WAAW,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,aAAa,CAAC,CAuDlF"}
|
|
@@ -20,11 +20,14 @@
|
|
|
20
20
|
* `records close` is in `records-close.ts`.
|
|
21
21
|
*
|
|
22
22
|
* `new --sign` and `amend --sign` seal the record's author (#2688), and
|
|
23
|
-
* `review --sign` seals a verdict (#2687): see `trust/seal.ts`.
|
|
23
|
+
* `review --sign` seals a verdict (#2687): see `trust/seal.ts`. A record of
|
|
24
|
+
* a kind that declares `seal` gets its whole-file seal when `new` or `amend`
|
|
25
|
+
* writes it into a closed state (#2546, ws-063).
|
|
24
26
|
*/
|
|
25
27
|
import type { CommandContext } from "../cli/registry.js";
|
|
26
28
|
import { type RecordSource } from "./record-source.js";
|
|
27
29
|
import { type LoadedRecordKind, type RecordEntry, type RecordWarning } from "./records.js";
|
|
30
|
+
import type { WriteVerb } from "./declaration.js";
|
|
28
31
|
/** The version of the write documents this chant prints. */
|
|
29
32
|
export declare const RECORDS_WRITE_CONTRACT_VERSION = 1;
|
|
30
33
|
export declare const RECORDS_NEW_SCHEMA_ID = "https://intentius.io/chant/schemas/workspace/records-new/v1/records-new.schema.json";
|
|
@@ -33,11 +36,11 @@ export declare const RECORDS_REVIEW_SCHEMA_ID = "https://intentius.io/chant/sche
|
|
|
33
36
|
/** Loading the kind and reading its records, as `records` reads them. */
|
|
34
37
|
export declare const LOAD_ERROR_CODES: readonly ["kind-unreadable", "kind-invalid", "schema-unreadable", "schema-id-mismatch", "schema-invalid", "location-missing"];
|
|
35
38
|
/** Why `records new` wrote nothing. Closed: a reader may switch on it. */
|
|
36
|
-
export declare const NEW_ERROR_CODES: readonly ["kind-unreadable", "kind-invalid", "schema-unreadable", "schema-id-mismatch", "schema-invalid", "location-missing", "write-usage-invalid", "write-input-invalid", "record-id-taken", "record-id-unallocatable", "record-path-unmatched", "record-sign-failed", "source-harvest-not-proposed", "record-state-not-initial", "ratify-quorum-not-met", "record-unparseable", "record-schema-invalid", "record-id-duplicate", "record-supersedes-unknown", "record-supersedes-conflict", "record-remediates-unknown", "record-remediates-not-closed", "session-seal-mismatch", "session-verdict-unknown-record"];
|
|
39
|
+
export declare const NEW_ERROR_CODES: readonly ["kind-unreadable", "kind-invalid", "schema-unreadable", "schema-id-mismatch", "schema-invalid", "location-missing", "write-usage-invalid", "write-input-invalid", "record-id-taken", "record-id-unallocatable", "record-path-unmatched", "record-sign-failed", "source-harvest-not-proposed", "record-state-not-initial", "ratify-quorum-not-met", "write-scope-member", "write-scope-kind", "agent-unknown", "record-unparseable", "record-schema-invalid", "record-id-duplicate", "record-supersedes-unknown", "record-supersedes-conflict", "record-remediates-unknown", "record-remediates-not-closed", "record-seal-mismatch", "session-seal-mismatch", "session-verdict-unknown-record"];
|
|
37
40
|
/** Why `records amend` wrote nothing. */
|
|
38
|
-
export declare const AMEND_ERROR_CODES: readonly ["kind-unreadable", "kind-invalid", "schema-unreadable", "schema-id-mismatch", "schema-invalid", "location-missing", "write-usage-invalid", "write-input-invalid", "record-not-found", "amend-id-immutable", "record-closed", "amend-supersede-instead", "record-sign-failed", "ratify-quorum-not-met", "record-unparseable", "record-schema-invalid", "record-id-duplicate", "record-supersedes-unknown", "record-supersedes-conflict", "record-remediates-unknown", "record-remediates-not-closed", "session-seal-mismatch", "session-verdict-unknown-record"];
|
|
41
|
+
export declare const AMEND_ERROR_CODES: readonly ["kind-unreadable", "kind-invalid", "schema-unreadable", "schema-id-mismatch", "schema-invalid", "location-missing", "write-usage-invalid", "write-input-invalid", "record-not-found", "amend-id-immutable", "record-closed", "amend-supersede-instead", "record-sign-failed", "ratify-quorum-not-met", "write-scope-member", "write-scope-kind", "agent-unknown", "record-unparseable", "record-schema-invalid", "record-id-duplicate", "record-supersedes-unknown", "record-supersedes-conflict", "record-remediates-unknown", "record-remediates-not-closed", "record-seal-mismatch", "session-seal-mismatch", "session-verdict-unknown-record"];
|
|
39
42
|
/** Why `records review` wrote nothing. */
|
|
40
|
-
export declare const REVIEW_ERROR_CODES: readonly ["kind-unreadable", "kind-invalid", "schema-unreadable", "schema-id-mismatch", "schema-invalid", "location-missing", "write-usage-invalid", "record-not-found", "review-unsupported", "record-closed", "review-note-required", "review-sign-failed", "session-unknown", "session-not-open", "record-unparseable", "record-schema-invalid", "record-id-duplicate", "record-supersedes-unknown", "record-supersedes-conflict", "record-remediates-unknown", "record-remediates-not-closed", "session-seal-mismatch", "session-verdict-unknown-record"];
|
|
43
|
+
export declare const REVIEW_ERROR_CODES: readonly ["kind-unreadable", "kind-invalid", "schema-unreadable", "schema-id-mismatch", "schema-invalid", "location-missing", "write-usage-invalid", "record-not-found", "review-unsupported", "record-closed", "review-note-required", "review-sign-failed", "session-unknown", "session-not-open", "write-scope-member", "write-scope-kind", "agent-unknown", "record-unparseable", "record-schema-invalid", "record-id-duplicate", "record-supersedes-unknown", "record-supersedes-conflict", "record-remediates-unknown", "record-remediates-not-closed", "record-seal-mismatch", "session-seal-mismatch", "session-verdict-unknown-record"];
|
|
41
44
|
export type NewErrorCode = (typeof NEW_ERROR_CODES)[number];
|
|
42
45
|
export type AmendErrorCode = (typeof AMEND_ERROR_CODES)[number];
|
|
43
46
|
export type ReviewErrorCode = (typeof REVIEW_ERROR_CODES)[number];
|
|
@@ -145,6 +148,15 @@ export interface Opened {
|
|
|
145
148
|
dirRel: string;
|
|
146
149
|
}
|
|
147
150
|
export declare function open(kind: string, cwd: string): Promise<Opened>;
|
|
151
|
+
/**
|
|
152
|
+
* Refuse a write outside the writer's scope (#2548): the kind `o` opened,
|
|
153
|
+
* written with `verb`, by the session `agent` names (`CHANT_AGENT`) or the
|
|
154
|
+
* principal `by` names. Throws a {@link WriteScopeError}.
|
|
155
|
+
*/
|
|
156
|
+
export declare function refuseOutOfScope(o: Opened, verb: WriteVerb, cwd: string, writer: {
|
|
157
|
+
agent?: string;
|
|
158
|
+
by?: string;
|
|
159
|
+
}): void;
|
|
148
160
|
/**
|
|
149
161
|
* The kind's records as `records` reads them from `source`. A session kind's
|
|
150
162
|
* subject records are read from the same source (#2693), so a write is
|
|
@@ -202,6 +214,8 @@ export interface NewRecordOptions {
|
|
|
202
214
|
* `reviews.decider` field, which the fields must set.
|
|
203
215
|
*/
|
|
204
216
|
sign?: string | true;
|
|
217
|
+
/** The agent session the write is made in (`CHANT_AGENT`, #2548), which its write scope binds. */
|
|
218
|
+
agent?: string;
|
|
205
219
|
}
|
|
206
220
|
/**
|
|
207
221
|
* A write made through a channel other than the command line (#2707), such
|
|
@@ -240,6 +254,8 @@ export interface AmendRecordOptions {
|
|
|
240
254
|
cwd: string;
|
|
241
255
|
/** Seal the amended record's author, as `records new` does (#2688). */
|
|
242
256
|
sign?: string | true;
|
|
257
|
+
/** The agent session the write is made in (#2548). */
|
|
258
|
+
agent?: string;
|
|
243
259
|
}
|
|
244
260
|
/**
|
|
245
261
|
* `records amend`: set top-level fields of one record. A record in a closed
|
|
@@ -274,6 +290,8 @@ export interface ReviewRecordOptions {
|
|
|
274
290
|
* git's `user.signingkey`. Without it the verdict is written unsealed.
|
|
275
291
|
*/
|
|
276
292
|
sign?: string | true;
|
|
293
|
+
/** The agent session the write is made in (#2548). */
|
|
294
|
+
agent?: string;
|
|
277
295
|
}
|
|
278
296
|
/**
|
|
279
297
|
* `records review`: append one verdict to a record's reviews, with the date
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"records-write.d.ts","sourceRoot":"","sources":["../../src/workspace/records-write.ts"],"names":[],"mappings":"AAAA
|
|
1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,mDAAmD;IACnD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,uEAAuE;IACvE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,sDAAsD;IACtD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;GAKG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,cAAc,CAAC,CA4ErF;AA+CD,eAAO,MAAM,WAAW,QAKZ,CAAC;AAMb;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,CAAC,qBAAqB,CAAC,CAa5H;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAcjE;AAgBD;;;GAGG;AACH,wBAAsB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,YAAY,CAAC,qBAAqB,CAAC,CAAC,CAK5H;AAED,uIAAuI;AACvI,wBAAsB,eAAe,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA2C1E"}
|
|
@@ -13,8 +13,10 @@
|
|
|
13
13
|
*
|
|
14
14
|
* A record that fails any of that is still returned, with reason codes, and the
|
|
15
15
|
* read succeeds. Only a failure to read the kind, its schema or the revision is
|
|
16
|
-
* an error.
|
|
17
|
-
* #
|
|
16
|
+
* an error. A closed record of a kind that declares `seal` is checked against
|
|
17
|
+
* its whole-file seal ({@link recordSeal}, #2546); author and verdict seals
|
|
18
|
+
* are checked by `records-cli.ts` against the policy at base. Nothing here
|
|
19
|
+
* needs a `chant.workspace.json`.
|
|
18
20
|
*
|
|
19
21
|
* Everything under `workspace/` loads only when a `chant workspace` command
|
|
20
22
|
* runs. The level-0 goldens (#2526) fail if a level-0 command loads it.
|
|
@@ -30,7 +32,7 @@ import type { AnswerWarningCode } from "./points.js";
|
|
|
30
32
|
* Why one record is not valid. The list is closed: a reader may switch on it,
|
|
31
33
|
* and a new code is a contract change (#2536).
|
|
32
34
|
*/
|
|
33
|
-
export declare const RECORD_REASON_CODES: readonly ["record-unparseable", "record-schema-invalid", "record-id-duplicate", "record-supersedes-unknown", "record-supersedes-conflict", "record-remediates-unknown", "record-remediates-not-closed", "session-seal-mismatch", "session-verdict-unknown-record"];
|
|
35
|
+
export declare const RECORD_REASON_CODES: readonly ["record-unparseable", "record-schema-invalid", "record-id-duplicate", "record-supersedes-unknown", "record-supersedes-conflict", "record-remediates-unknown", "record-remediates-not-closed", "record-seal-mismatch", "session-seal-mismatch", "session-verdict-unknown-record"];
|
|
34
36
|
export type RecordReasonCode = (typeof RECORD_REASON_CODES)[number];
|
|
35
37
|
/**
|
|
36
38
|
* Why a record carries a warning. Closed, like the reason codes. A warning
|
|
@@ -72,7 +74,9 @@ export declare const RECORD_SEAL_FIELD = "seal";
|
|
|
72
74
|
* moving a record to that state keeps the verdicts that ratified it
|
|
73
75
|
* counting.
|
|
74
76
|
*/
|
|
75
|
-
export declare function digestFields(kind: Pick<RecordKind, "reviews" | "stateField">): string[] | null;
|
|
77
|
+
export declare function digestFields(kind: Pick<RecordKind, "reviews" | "stateField" | "seal">): string[] | null;
|
|
78
|
+
/** The field holding a closed record's whole-file seal: the kind's `seal.field`, or a session kind's `session.seal` (#2546, #2673). */
|
|
79
|
+
export declare function sealFieldOf(kind: Pick<RecordKind, "seal" | "session">): string | undefined;
|
|
76
80
|
/** What a verdict's seal establishes (#2687). See `trust/seal.ts`. */
|
|
77
81
|
export interface VerdictAttestation {
|
|
78
82
|
/** Why the verdict is not attested. Absent when its seal verified. */
|
|
@@ -177,6 +181,10 @@ export declare const recordKindSchema: z.ZodObject<{
|
|
|
177
181
|
answers: z.ZodOptional<z.ZodObject<{
|
|
178
182
|
points: z.ZodString;
|
|
179
183
|
}, z.core.$strict>>;
|
|
184
|
+
seal: z.ZodOptional<z.ZodObject<{
|
|
185
|
+
field: z.ZodString;
|
|
186
|
+
}, z.core.$strict>>;
|
|
187
|
+
spec: z.ZodOptional<z.ZodBoolean>;
|
|
180
188
|
}, z.core.$strict>;
|
|
181
189
|
/** The states of an answer kind's records (ws-058): open for people, proposed by a model, answered by a table, people, or a confirmed proposal. */
|
|
182
190
|
export declare const ANSWER_STATES: readonly ["escalated", "proposed", "answered"];
|
|
@@ -238,7 +246,9 @@ export declare function parseRecord(format: RecordFormat, text: string): FrontMa
|
|
|
238
246
|
* record's author seal (#2688; {@link digestFields}), so sealing a record
|
|
239
247
|
* leaves its digest where it was too. A record with no `seal` hashes exactly
|
|
240
248
|
* as it did before author seals existed. A kind with `reviews.ratified` adds
|
|
241
|
-
* its state field (#2873)
|
|
249
|
+
* its state field (#2873), and a kind with `seal` its seal field (#2546), so
|
|
250
|
+
* the whole-file seal written at the close moves no digest. The digest is not
|
|
251
|
+
* that seal: {@link recordSeal} covers the whole record.
|
|
242
252
|
*
|
|
243
253
|
* The rule, which a hand-editor can follow with a text editor and
|
|
244
254
|
* `sha256sum`:
|
|
@@ -260,6 +270,34 @@ export declare function parseRecord(format: RecordFormat, text: string): FrontMa
|
|
|
260
270
|
* counting.
|
|
261
271
|
*/
|
|
262
272
|
export declare function recordTextDigest(text: string, field?: string | readonly string[] | null, format?: RecordFormat): string;
|
|
273
|
+
/**
|
|
274
|
+
* The seal of a closed record (#2546, ws-003, ws-063): `sha256:` and the
|
|
275
|
+
* lowercase hex SHA-256 of the RFC 8785 (JCS) form of the whole record, with
|
|
276
|
+
* only the field that holds the seal left out. It is a separate hash from
|
|
277
|
+
* {@link recordTextDigest}, which a review verdict names: the digest leaves
|
|
278
|
+
* out the reviews, the author seal and the state so verdicts keep counting,
|
|
279
|
+
* and the seal covers all of them.
|
|
280
|
+
*
|
|
281
|
+
* 1. Line endings become LF (CRLF and a lone CR each become one LF).
|
|
282
|
+
* 2. The structured core is parsed as the kind's format says: the front
|
|
283
|
+
* matter, as the JSON subset of YAML, or the whole JSON object. The
|
|
284
|
+
* top-level member `field` is removed from it.
|
|
285
|
+
* 3. For a Markdown record the value hashed is the object
|
|
286
|
+
* `{"body": <the text after the closing --- line>, "core": <the core>}`;
|
|
287
|
+
* for a JSON record it is the core itself.
|
|
288
|
+
* 4. That value is written in JCS (keys sorted by UTF-16 code units, no
|
|
289
|
+
* whitespace, ECMAScript number and string forms) and hashed as UTF-8.
|
|
290
|
+
*
|
|
291
|
+
* So every value in the record and every byte of its body is sealed, the
|
|
292
|
+
* reviews, the author seal and the state included, while the key order,
|
|
293
|
+
* quoting and indentation of the front matter are not: the same record
|
|
294
|
+
* written another way has the same seal. A YAML comment in the front matter
|
|
295
|
+
* is not part of the record, so it is not sealed either (#3066). Returns null when
|
|
296
|
+
* the core can't be parsed.
|
|
297
|
+
*/
|
|
298
|
+
export declare function recordSeal(text: string, field: string, format?: RecordFormat): string | null;
|
|
299
|
+
/** The text below a Markdown file's front matter, with LF line endings: everything after the closing `---` line. */
|
|
300
|
+
export declare function bodyText(text: string): string;
|
|
263
301
|
/** The quorum a workspace sets when its declaration names none: two verdicts besides the decider's (#2555). */
|
|
264
302
|
export declare const DEFAULT_QUORUM = 2;
|
|
265
303
|
/** A principal as the quorum compares it: NFKC, trimmed and lower-cased, so `alice` and `Alice ` are one reviewer (#2671). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"records.d.ts","sourceRoot":"","sources":["../../src/workspace/records.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"records.d.ts","sourceRoot":"","sources":["../../src/workspace/records.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAQH,OAAO,E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AE,CAAC;IACvD;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,+DAA+D;AAC/D,MAAM,WAAW,aAAa;IAC5B,2FAA2F;IAC3F,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IACzC,+GAA+G;IAC/G,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;CACvC;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/E,8GAA8G;IAC9G,SAAS,CAAC,EAAE,YAAY,EAAE,CAAC;CAC5B;AA0DD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAAC,UAAU,EAAE,YAAY,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,MAAM,EAAE,CAQtH;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAAC,UAAU,EAAE,YAAY,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,MAAM,EAAE,CAQtH;AAWD,oEAAoE;AACpE,wBAAsB,WAAW,CAAC,MAAM,EAAE,gBAAgB,EAAE,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAwNnH"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns: the record an import writes when a copy of the workspace comes
|
|
3
|
+
* back (#2552, #2524 D10, ws-004, ws-073).
|
|
4
|
+
*
|
|
5
|
+
* `chant workspace import` writes `.chant/returns/<id>.json` at the workspace
|
|
6
|
+
* root, beside the lock. It names the export the copy started from, the
|
|
7
|
+
* copy's HEAD when the copy is a git repository of its own, and every path
|
|
8
|
+
* the import wrote or removed. For each written path whose bytes are the
|
|
9
|
+
* copy's own (no host value was switched back into it), it also carries the
|
|
10
|
+
* origin: the raw commit object that last changed the file in the copy, and
|
|
11
|
+
* the raw tree objects from that commit's root tree down to the file. Those
|
|
12
|
+
* objects hash to the ids that name them, so anyone can check offline that
|
|
13
|
+
* the commit, with its original signature, holds exactly the bytes the
|
|
14
|
+
* workspace now has. Nothing is re-signed: the signature is the one the
|
|
15
|
+
* author made where the copy lived.
|
|
16
|
+
*
|
|
17
|
+
* The commit is judged by the attestors of #2547 with the policy at base. A
|
|
18
|
+
* signer the base policy does not list makes it `attested-unverifiable-here`,
|
|
19
|
+
* not `unattested`: there is a signature, and nothing here can say whose key
|
|
20
|
+
* it is. An admin admits the signers by adding them to `.chant/trust.json`
|
|
21
|
+
* under `admitted`, naming the return (`chant workspace admit <id>`). That
|
|
22
|
+
* file is policy, read at base, and changing it is a protected write, so the
|
|
23
|
+
* admission is signed by the admin's own commit. From then on, the returned
|
|
24
|
+
* commits read as `attested`. An admitted key verifies only that return's
|
|
25
|
+
* commits and seals, never a commit made in the workspace's own repository.
|
|
26
|
+
*/
|
|
27
|
+
import { z } from "zod";
|
|
28
|
+
import type { WorkspaceTree } from "./tree.js";
|
|
29
|
+
import { type CommitAttestor } from "./trust/attestor.js";
|
|
30
|
+
import { type TrustPolicy } from "./trust/policy.js";
|
|
31
|
+
import type { RecordProvenance } from "./trust/provenance.js";
|
|
32
|
+
/** Where return records live, relative to the workspace root. */
|
|
33
|
+
export declare const RETURNS_DIR = ".chant/returns";
|
|
34
|
+
declare const OriginSchema: z.ZodObject<{
|
|
35
|
+
commit: z.ZodString;
|
|
36
|
+
raw: z.ZodString;
|
|
37
|
+
trees: z.ZodArray<z.ZodString>;
|
|
38
|
+
}, z.core.$strict>;
|
|
39
|
+
export type ReturnOrigin = z.infer<typeof OriginSchema>;
|
|
40
|
+
declare const ReturnSchema: z.ZodObject<{
|
|
41
|
+
schema: z.ZodLiteral<1>;
|
|
42
|
+
id: z.ZodString;
|
|
43
|
+
export: z.ZodObject<{
|
|
44
|
+
id: z.ZodString;
|
|
45
|
+
workspace: z.ZodString;
|
|
46
|
+
revision: z.ZodNullable<z.ZodString>;
|
|
47
|
+
}, z.core.$strict>;
|
|
48
|
+
head: z.ZodNullable<z.ZodString>;
|
|
49
|
+
paths: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
50
|
+
sha256: z.ZodString;
|
|
51
|
+
origin: z.ZodOptional<z.ZodObject<{
|
|
52
|
+
commit: z.ZodString;
|
|
53
|
+
raw: z.ZodString;
|
|
54
|
+
trees: z.ZodArray<z.ZodString>;
|
|
55
|
+
}, z.core.$strict>>;
|
|
56
|
+
}, z.core.$strict>>;
|
|
57
|
+
removed: z.ZodArray<z.ZodString>;
|
|
58
|
+
hostValues: z.ZodArray<z.ZodString>;
|
|
59
|
+
signers: z.ZodArray<z.ZodObject<{
|
|
60
|
+
key: z.ZodString;
|
|
61
|
+
fingerprint: z.ZodString;
|
|
62
|
+
principal: z.ZodString;
|
|
63
|
+
commits: z.ZodArray<z.ZodString>;
|
|
64
|
+
}, z.core.$strict>>;
|
|
65
|
+
}, z.core.$strict>;
|
|
66
|
+
export type ReturnRecord = z.infer<typeof ReturnSchema>;
|
|
67
|
+
/** The id git gives an object: the hash of `<type> <length>\0<data>`, SHA-1 or SHA-256 by the id length in use. */
|
|
68
|
+
export declare function gitObjectId(type: "blob" | "tree" | "commit", data: Buffer, algorithm: "sha1" | "sha256"): string;
|
|
69
|
+
/** The entries of a raw tree object: mode, name and id. */
|
|
70
|
+
export declare function parseTree(raw: Buffer, idBytes: number): {
|
|
71
|
+
mode: string;
|
|
72
|
+
name: string;
|
|
73
|
+
id: string;
|
|
74
|
+
}[];
|
|
75
|
+
/**
|
|
76
|
+
* The origin of `path` (relative to the copy's root) in the copy's own
|
|
77
|
+
* repository at `dir`: the last commit that changed it, and the tree objects
|
|
78
|
+
* down to it. Undefined when the file at that commit is not `content`, such
|
|
79
|
+
* as a file with uncommitted changes.
|
|
80
|
+
*/
|
|
81
|
+
export declare function buildOrigin(dir: string, path: string, content: Buffer): ReturnOrigin | undefined;
|
|
82
|
+
/** Check that `origin`'s objects hash to their ids and lead from the commit to `content` at `path`. */
|
|
83
|
+
export declare function verifyOrigin(origin: ReturnOrigin, path: string, content: Buffer): {
|
|
84
|
+
ok: true;
|
|
85
|
+
} | {
|
|
86
|
+
ok: false;
|
|
87
|
+
reason: string;
|
|
88
|
+
};
|
|
89
|
+
/** The keys that signed the origins, grouped by key, for an admin to admit. */
|
|
90
|
+
export declare function originSigners(origins: readonly ReturnOrigin[]): ReturnRecord["signers"];
|
|
91
|
+
export declare function parseReturn(text: string, label: string): ReturnRecord;
|
|
92
|
+
export declare function renderReturn(r: ReturnRecord): string;
|
|
93
|
+
export declare function writeReturn(root: string, r: ReturnRecord): string;
|
|
94
|
+
/** The return records in `tree` (the workspace root's), sorted by id. Unreadable ones are skipped and named in `problems`. */
|
|
95
|
+
export declare function readReturns(tree: WorkspaceTree): {
|
|
96
|
+
returns: ReturnRecord[];
|
|
97
|
+
problems: string[];
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* The provenance of a returned file: its origin commit judged by the
|
|
101
|
+
* attestors with the policy at base plus the signers admitted for the
|
|
102
|
+
* return. Undefined when the return holds no origin for the path, or the
|
|
103
|
+
* workspace's bytes are not the ones returned, so the commit that holds the
|
|
104
|
+
* file here is what counts.
|
|
105
|
+
*/
|
|
106
|
+
export declare function returnedProvenance(policy: TrustPolicy, attestors: readonly CommitAttestor[], ret: ReturnRecord, path: string, content: Buffer, host: RecordProvenance): RecordProvenance | undefined;
|
|
107
|
+
export interface AdmitResult {
|
|
108
|
+
id: string;
|
|
109
|
+
/** Repository-relative path of the trust config. */
|
|
110
|
+
path: string;
|
|
111
|
+
/** The signers added. Empty when every one was already admitted. */
|
|
112
|
+
added: {
|
|
113
|
+
principal: string;
|
|
114
|
+
key: string;
|
|
115
|
+
}[];
|
|
116
|
+
written: boolean;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Add the signers of return `ret` to the `admitted` list of
|
|
120
|
+
* `.chant/trust.json` at the repository root `repo`, keeping everything else
|
|
121
|
+
* in it. The admission counts once an admin's signed commit merges it: the
|
|
122
|
+
* file is policy, read at base, and a protected write.
|
|
123
|
+
*/
|
|
124
|
+
export declare function admitReturn(repo: string, ret: ReturnRecord, opts?: {
|
|
125
|
+
note?: string;
|
|
126
|
+
dryRun?: boolean;
|
|
127
|
+
}): AdmitResult;
|
|
128
|
+
export {};
|
|
129
|
+
//# sourceMappingURL=returns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"returns.d.ts","sourceRoot":"","sources":["../../src/workspace/returns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAMH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,EAAmB,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAqC,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACrF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAG3D,iEAAiE;AACjE,eAAO,MAAM,WAAW,mBAAmB,CAAC;AAM5C,QAAA,MAAM,YAAY;;;;kBASP,CAAC;AACZ,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAExD,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;kBA0BP,CAAC;AACZ,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAIxD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;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,WAAW,EACnB,SAAS,EAAE,SAAS,cAAc,EAAE,EACpC,GAAG,EAAE,YAAY,EACjB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,gBAAgB,GACrB,gBAAgB,GAAG,SAAS,CA+B9B;AAID,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,oDAAoD;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,oEAAoE;IACpE,KAAK,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC5C,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,YAAY,EAAE,IAAI,GAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,WAAW,CAoBxH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status-gates.d.ts","sourceRoot":"","sources":["../../src/workspace/status-gates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;
|
|
1
|
+
{"version":3,"file":"status-gates.d.ts","sourceRoot":"","sources":["../../src/workspace/status-gates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AASH,qFAAqF;AACrF,eAAO,MAAM,iBAAiB,iFAOY,CAAC;AAC3C,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhE,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,GAAG,YAAY,CAAC;AAE1E,MAAM,WAAW,kBAAkB;IACjC,gFAAgF;IAChF,SAAS,EAAE,MAAM,CAAC;IAClB,wGAAwG;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AM,GAAG,IAAI,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAEtH;AAgDD;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,UAAU,EAAE,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAkBlJ;AAED,8EAA8E;AAC9E,wBAAsB,eAAe,CACnC,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,SAAS,GAAG,MAAM,EAC1B,MAAM,EAAE,MAAM,GAAG,IAAI,EACrB,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,IAAI,GAAE,gBAA0C,GAC/C,OAAO,CAAC;IAAE,KAAK,EAAE,UAAU,EAAE,CAAC;IAAC,MAAM,EAAE,gBAAgB,CAAA;CAAE,CAAC,CAsB5D"}
|
|
@@ -26,9 +26,12 @@
|
|
|
26
26
|
* the merge base and the target version, so an unedited file carrying a value
|
|
27
27
|
* still has its recorded hash.
|
|
28
28
|
*
|
|
29
|
-
* `hostBound`
|
|
30
|
-
*
|
|
31
|
-
*
|
|
29
|
+
* A parameter marked `hostBound` holds a value that differs per host, such
|
|
30
|
+
* as the domain a hosted service serves the app on. Its value is recorded in
|
|
31
|
+
* `parameters` like any other, and the lineage also records, under
|
|
32
|
+
* `hostBound`, the files whose template text carries it, so `chant workspace
|
|
33
|
+
* export` can switch the value for the export and `import` can switch it
|
|
34
|
+
* back without fetching the template (#2552).
|
|
32
35
|
*/
|
|
33
36
|
import { z } from "zod";
|
|
34
37
|
import { LockError } from "./lineage-lock.js";
|
|
@@ -86,5 +89,10 @@ export declare function substituteParameters(files: Map<string, Buffer>, manifes
|
|
|
86
89
|
* one it adds. A recorded parameter the version no longer declares is dropped.
|
|
87
90
|
*/
|
|
88
91
|
export declare function carryParameters(manifest: TemplateManifest | null, recorded: Record<string, unknown>): Record<string, string>;
|
|
92
|
+
/**
|
|
93
|
+
* The host-bound parameters of a template (#2552), each with the listed files
|
|
94
|
+
* whose text carries its placeholder. Undefined when the template declares none.
|
|
95
|
+
*/
|
|
96
|
+
export declare function hostBoundFiles(files: Map<string, Buffer>, manifest: TemplateManifest | null): Record<string, string[]> | undefined;
|
|
89
97
|
export {};
|
|
90
98
|
//# sourceMappingURL=template-manifest.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template-manifest.d.ts","sourceRoot":"","sources":["../../src/workspace/template-manifest.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"template-manifest.d.ts","sourceRoot":"","sources":["../../src/workspace/template-manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAG3C,2GAA2G;AAC3G,eAAO,MAAM,iBAAiB,wBAAwB,CAAC;AAOvD,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED,QAAA,MAAM,eAAe;;;;;;kBAUV,CAAC;AACZ,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAEhE,QAAA,MAAM,cAAc;;;;;;;;;;kBAMT,CAAC;AACZ,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAM9D,qBAAa,sBAAuB,SAAQ,SAAS;IAC1C,IAAI,SAA4B;CAC1C;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,gBAAgB,GAAG,IAAI,CAoChF;AAQD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAU9E;AAOD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAwB1H;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAC1B,QAAQ,EAAE,gBAAgB,GAAG,IAAI,EACjC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC7B,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAiBrB;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,gBAAgB,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAO5H;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,gBAAgB,GAAG,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG,SAAS,CASlI"}
|
|
@@ -51,6 +51,12 @@ export interface CommitAttestor {
|
|
|
51
51
|
/** A stable name, such as `ssh-commit`. */
|
|
52
52
|
readonly name: string;
|
|
53
53
|
attestCommit(ctx: AttestorContext, commit: string): CommitAttestation;
|
|
54
|
+
/**
|
|
55
|
+
* Judge a commit object that is not in this repository, given its raw bytes
|
|
56
|
+
* (`git cat-file commit` output), such as one a return carries (#2552).
|
|
57
|
+
* Optional: an attestor without it is not asked.
|
|
58
|
+
*/
|
|
59
|
+
attestRaw?(ctx: AttestorContext, raw: Buffer): CommitAttestation;
|
|
54
60
|
}
|
|
55
61
|
/** Add an attestor. Later registrations are asked after earlier ones. */
|
|
56
62
|
export declare function registerAttestor(attestor: CommitAttestor): void;
|
|
@@ -62,6 +68,8 @@ export declare function resetAttestors(): void;
|
|
|
62
68
|
* can check is still reported as there.
|
|
63
69
|
*/
|
|
64
70
|
export declare function attestCommit(ctx: AttestorContext, commit: string, attestors: readonly CommitAttestor[]): CommitAttestation;
|
|
71
|
+
/** {@link attestCommit} for a raw commit object, asking only the attestors that judge one. */
|
|
72
|
+
export declare function attestRawCommit(ctx: AttestorContext, raw: Buffer, attestors: readonly CommitAttestor[]): CommitAttestation;
|
|
65
73
|
/** The attestors in use: the built-in ones first, then any registered. */
|
|
66
74
|
export declare function activeAttestors(): Promise<CommitAttestor[]>;
|
|
67
75
|
//# sourceMappingURL=attestor.d.ts.map
|