@okfit/engine 0.14.1 → 0.15.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/edits/FrontmatterEdits.js +66 -18
- package/errors.js +24 -3
- package/index.d.ts +400 -49
- package/index.js +8 -6
- package/package.json +19 -18
- package/query/ConceptQuery.js +15 -4
- package/render/context.js +20 -3
- package/render/query.js +53 -6
- package/render/sync.js +4 -1
- package/render/verify.js +43 -1
- package/session/BundleSession.js +3 -1
- package/sync/generated.js +112 -49
- package/sync/publication.js +3 -3
- package/sync/run.js +13 -4
- package/trust/run.js +32 -0
- package/validate/run.js +8 -4
- package/verify/diff.js +63 -0
- package/verify/integrity.js +309 -0
- package/verify/locate.js +3 -10
- package/verify/revoke.js +101 -0
- package/verify/run.js +157 -21
- package/verify/select.js +30 -11
- package/verify/splice.js +20 -34
- package/version.js +1 -1
package/index.d.ts
CHANGED
|
@@ -2,12 +2,13 @@ import { Actor, BundleLoadError, ConceptId, Diagnostic, DiagnosticRange, Diagnos
|
|
|
2
2
|
import { Context, Crypto, DateTime, Effect, FileSystem, Layer, Option, Path, PlatformError, Result, Runtime, Schema } from "effect";
|
|
3
3
|
import { AppDirs, Xdg } from "@effected/xdg";
|
|
4
4
|
import { ConfigReadError } from "@effected/config-file";
|
|
5
|
-
import { GeneratedAtError, GitHistory, GitHistoryError, Layout, Profile, ProfileDiagnostic } from "@okfit/profiles";
|
|
5
|
+
import { ConceptSignal, DriftReason, GeneratedAtError, GitHistory, GitHistoryError, IntegrityState, Layout, Profile, ProfileDiagnostic } from "@okfit/profiles";
|
|
6
6
|
import { FrontmatterWriteError, MarkdownEdit, MarkdownParseError } from "@effected/markdown";
|
|
7
7
|
import { YamlParseError } from "@effected/yaml";
|
|
8
8
|
import * as NodeServices from "@effect/platform-node/NodeServices";
|
|
9
9
|
import { Distribution as Distribution$1 } from "@effected/engine";
|
|
10
10
|
import { Git, GitCommandError, UnknownRefError } from "@effected/git";
|
|
11
|
+
import { ChildProcessSpawner } from "effect/process";
|
|
11
12
|
//#region src/config/anchor.d.ts
|
|
12
13
|
/**
|
|
13
14
|
* What {@link resolveProjectRoot} needs about the winning discovery source
|
|
@@ -126,7 +127,7 @@ export declare class VerifyConceptNotFoundError extends VerifyConceptNotFoundErr
|
|
|
126
127
|
declare const VerifyUnsupportedFrontmatterError_base: Schema.Class<VerifyUnsupportedFrontmatterError, Schema.TaggedStruct<"VerifyUnsupportedFrontmatterError", {
|
|
127
128
|
readonly id: Schema.String;
|
|
128
129
|
readonly shape: Schema.String;
|
|
129
|
-
readonly key: Schema.optionalKey<Schema.Literals<readonly ["verified", "status", "stale_after"]>>;
|
|
130
|
+
readonly key: Schema.optionalKey<Schema.Literals<readonly ["verified", "status", "stale_after", "integrity"]>>;
|
|
130
131
|
}>, import("effect/Cause").YieldableError>;
|
|
131
132
|
/**
|
|
132
133
|
* V-14: fail closed on a `verified` (or, under `--stable`/`--draft`, `status`)
|
|
@@ -142,6 +143,21 @@ export declare class VerifyUnsupportedFrontmatterError extends VerifyUnsupported
|
|
|
142
143
|
readonly [Runtime.errorExitCode] = 3;
|
|
143
144
|
get message(): string;
|
|
144
145
|
}
|
|
146
|
+
declare const VerifyNothingToRevokeError_base: Schema.Class<VerifyNothingToRevokeError, Schema.TaggedStruct<"VerifyNothingToRevokeError", {
|
|
147
|
+
readonly id: Schema.String;
|
|
148
|
+
readonly actor: Schema.String;
|
|
149
|
+
}>, import("effect/Cause").YieldableError>;
|
|
150
|
+
/**
|
|
151
|
+
* `okfit verify --revoke` found no `verified` entry by the resolved actor on
|
|
152
|
+
* the concept, so there is nothing to remove. Exit 3, like any other verify
|
|
153
|
+
* outcome that cannot proceed on the concept.
|
|
154
|
+
*
|
|
155
|
+
* @public
|
|
156
|
+
*/
|
|
157
|
+
export declare class VerifyNothingToRevokeError extends VerifyNothingToRevokeError_base {
|
|
158
|
+
readonly [Runtime.errorExitCode] = 3;
|
|
159
|
+
get message(): string;
|
|
160
|
+
}
|
|
145
161
|
declare const ConfigMalformedError_base: Schema.Class<ConfigMalformedError, Schema.TaggedStruct<"ConfigMalformedError", {
|
|
146
162
|
readonly path: Schema.String;
|
|
147
163
|
readonly cause: Schema.Defect;
|
|
@@ -201,7 +217,7 @@ export declare class SyncPublicationConflictError extends SyncPublicationConflic
|
|
|
201
217
|
get message(): string;
|
|
202
218
|
}
|
|
203
219
|
declare const VerifySelectionError_base: Schema.Class<VerifySelectionError, Schema.TaggedStruct<"VerifySelectionError", {
|
|
204
|
-
readonly reason: Schema.Literals<readonly ["no-selection", "id-and-batch", "unknown-type", "status-conflict", "status-and-batch", "dry-run-needs-verify"]>;
|
|
220
|
+
readonly reason: Schema.Literals<readonly ["no-selection", "id-and-batch", "unknown-type", "status-conflict", "status-and-batch", "dry-run-needs-verify", "revoke-needs-id", "revoke-conflict"]>;
|
|
205
221
|
readonly detail: Schema.optionalKey<Schema.String>;
|
|
206
222
|
}>, import("effect/Cause").YieldableError>;
|
|
207
223
|
/**
|
|
@@ -488,28 +504,36 @@ export declare class FrontmatterEdits {
|
|
|
488
504
|
private constructor();
|
|
489
505
|
/** Edits that set top-level `status` to `status`, replacing an existing scalar or inserting after `title:` (else `type:`). */
|
|
490
506
|
static readonly status: (source: string, status: Status) => Effect.Effect<ReadonlyArray<MarkdownEdit>, YamlParseError | UnsupportedFrontmatterError>;
|
|
491
|
-
/**
|
|
507
|
+
/**
|
|
508
|
+
* Edits that append one verified entry and bind it with `integrity.verified`
|
|
509
|
+
* (`content` is the content digest of the source as passed), the same splice
|
|
510
|
+
* `okfit verify` performs. Only the `verified` slot of an existing `integrity`
|
|
511
|
+
* block is rewritten.
|
|
512
|
+
*/
|
|
492
513
|
static readonly verified: (source: string, entry: {
|
|
493
514
|
readonly by: string;
|
|
494
515
|
readonly at: string;
|
|
495
|
-
}) => Effect.Effect<ReadonlyArray<MarkdownEdit>, YamlParseError | UnsupportedFrontmatterError>;
|
|
516
|
+
}, content: string) => Effect.Effect<ReadonlyArray<MarkdownEdit>, YamlParseError | UnsupportedFrontmatterError>;
|
|
496
517
|
/**
|
|
497
|
-
* Edits that append one verified entry AND set top-level
|
|
498
|
-
* `okfit verify --stable` performs. A `status` scalar already
|
|
499
|
-
* status edit, and equal-offset inserts are merged with `status:`
|
|
500
|
-
*
|
|
501
|
-
* on it fails even when its value
|
|
518
|
+
* Edits that append one verified entry, bind it with `integrity.verified` AND set top-level
|
|
519
|
+
* `status`, the combined write `okfit verify --stable` performs. A `status` scalar already
|
|
520
|
+
* equal to `status` makes no status edit, and equal-offset inserts are merged with `status:`
|
|
521
|
+
* first, then `verified:`, then `integrity:`. Unlike the CLI, which reads the parsed status,
|
|
522
|
+
* this always locates `status`, so an unsupported shape on it fails even when its value
|
|
523
|
+
* already matches.
|
|
502
524
|
*/
|
|
503
525
|
static readonly verifiedWithStatus: (source: string, entry: {
|
|
504
526
|
readonly by: string;
|
|
505
527
|
readonly at: string;
|
|
506
|
-
}, status: Status) => Effect.Effect<ReadonlyArray<MarkdownEdit>, YamlParseError | UnsupportedFrontmatterError>;
|
|
528
|
+
}, status: Status, content: string) => Effect.Effect<ReadonlyArray<MarkdownEdit>, YamlParseError | UnsupportedFrontmatterError>;
|
|
507
529
|
/**
|
|
508
|
-
* Edits that stamp `renders[i].
|
|
509
|
-
* place, a missing key is inserted on the line after
|
|
510
|
-
*
|
|
530
|
+
* Edits that stamp `renders[i].body` with `digests[i]` (16 hex, quoted when numeric-looking): an
|
|
531
|
+
* existing value is replaced in place, a missing key is inserted on the line after
|
|
532
|
+
* `renders[i].path` at that key's column. An `undefined` digest skips its entry. A legacy `renders[i].body_sha256` line in the same
|
|
533
|
+
* entry is removed, so an entry never ends up with both keys. Block-style `renders` only; flow
|
|
534
|
+
* style fails with `UnsupportedFrontmatterError`.
|
|
511
535
|
*/
|
|
512
|
-
static readonly rendersDigests: (source: string, digests: ReadonlyArray<string>) => Effect.Effect<ReadonlyArray<MarkdownEdit>, YamlParseError | UnsupportedFrontmatterError>;
|
|
536
|
+
static readonly rendersDigests: (source: string, digests: ReadonlyArray<string | undefined>) => Effect.Effect<ReadonlyArray<MarkdownEdit>, YamlParseError | UnsupportedFrontmatterError>;
|
|
513
537
|
}
|
|
514
538
|
//#endregion
|
|
515
539
|
//#region src/external/ExternalReferences.d.ts
|
|
@@ -754,8 +778,12 @@ interface ConceptFilter {
|
|
|
754
778
|
readonly tags?: ReadonlyArray<string>;
|
|
755
779
|
/** OR, compared against `Derive.status` (an absent status reads as stable). */
|
|
756
780
|
readonly statuses?: ReadonlyArray<Status>;
|
|
757
|
-
/** `
|
|
758
|
-
readonly verified?:
|
|
781
|
+
/** `"current"`: integrity current; `"unverified"`: tier unverified. */
|
|
782
|
+
readonly verified?: "current" | "unverified";
|
|
783
|
+
/** `true`: integrity drifted. */
|
|
784
|
+
readonly drifted?: boolean;
|
|
785
|
+
/** `true`: `stale_after` has passed. */
|
|
786
|
+
readonly stale?: boolean;
|
|
759
787
|
}
|
|
760
788
|
/** One outgoing link of a concept. @public */
|
|
761
789
|
interface ConceptLink {
|
|
@@ -777,8 +805,12 @@ interface ConceptNeighbor {
|
|
|
777
805
|
* @public
|
|
778
806
|
*/
|
|
779
807
|
export declare const ConceptQuery: {
|
|
780
|
-
/**
|
|
781
|
-
|
|
808
|
+
/**
|
|
809
|
+
* Validates types then tags against config (first unknown fails), then filters
|
|
810
|
+
* and sorts by id. `signals` is `Trust.signals(bundle, config, now)`; a concept with
|
|
811
|
+
* no signal is a caller defect.
|
|
812
|
+
*/
|
|
813
|
+
readonly list: (bundle: LoadedBundle, config: OkfitConfig, filter: ConceptFilter, signals: ReadonlyMap<string, ConceptSignal>) => Effect.Effect<ReadonlyArray<LoadedConcept>, QueryUnknownVocabularyError>;
|
|
782
814
|
/** One concept by tolerant id, with its outgoing links. */
|
|
783
815
|
readonly get: (bundle: LoadedBundle, id: string) => Effect.Effect<{
|
|
784
816
|
readonly concept: LoadedConcept;
|
|
@@ -852,6 +884,23 @@ export declare const ContextTag: Schema.Struct<{
|
|
|
852
884
|
}>;
|
|
853
885
|
/** @public */
|
|
854
886
|
export type ContextTag = typeof ContextTag.Type;
|
|
887
|
+
/**
|
|
888
|
+
* The `--trust` summary: how many concepts have drifted, are stale, or are
|
|
889
|
+
* unverified, with the first five drifted and stale ids (sorted). Counts
|
|
890
|
+
* overlap (a concept can be both drifted and stale).
|
|
891
|
+
*
|
|
892
|
+
* @public
|
|
893
|
+
*/
|
|
894
|
+
export declare const ContextTrust: Schema.Struct<{
|
|
895
|
+
readonly concepts: Schema.Int;
|
|
896
|
+
readonly drifted: Schema.Int;
|
|
897
|
+
readonly stale: Schema.Int;
|
|
898
|
+
readonly unverified: Schema.Int;
|
|
899
|
+
readonly drifted_ids: Schema.$Array<Schema.String>;
|
|
900
|
+
readonly stale_ids: Schema.$Array<Schema.String>;
|
|
901
|
+
}>;
|
|
902
|
+
/** @public */
|
|
903
|
+
export type ContextTrust = typeof ContextTrust.Type;
|
|
855
904
|
/**
|
|
856
905
|
* M-15's envelope: schema 1, snake_case, orientation data only. Distinct
|
|
857
906
|
* from `JsonEnvelope` (`render/json.ts`) — `context` never runs conformance
|
|
@@ -914,6 +963,14 @@ export declare const ContextEnvelope: Schema.Struct<{
|
|
|
914
963
|
readonly name: Schema.String;
|
|
915
964
|
readonly description: Schema.NullOr<Schema.String>;
|
|
916
965
|
}>>;
|
|
966
|
+
readonly trust: Schema.NullOr<Schema.Struct<{
|
|
967
|
+
readonly concepts: Schema.Int;
|
|
968
|
+
readonly drifted: Schema.Int;
|
|
969
|
+
readonly stale: Schema.Int;
|
|
970
|
+
readonly unverified: Schema.Int;
|
|
971
|
+
readonly drifted_ids: Schema.$Array<Schema.String>;
|
|
972
|
+
readonly stale_ids: Schema.$Array<Schema.String>;
|
|
973
|
+
}>>;
|
|
917
974
|
}>;
|
|
918
975
|
/** @public */
|
|
919
976
|
export type ContextEnvelope = typeof ContextEnvelope.Type;
|
|
@@ -934,6 +991,8 @@ export declare const contextEnvelope: (input: {
|
|
|
934
991
|
readonly indexPath: string;
|
|
935
992
|
readonly indexExists: boolean;
|
|
936
993
|
readonly config: OkfitConfig;
|
|
994
|
+
/** Present only under `--trust`; absent becomes `null` on the wire. */
|
|
995
|
+
readonly trust?: ContextTrust;
|
|
937
996
|
}) => ContextEnvelope;
|
|
938
997
|
//#endregion
|
|
939
998
|
//#region src/render/distribution.d.ts
|
|
@@ -1229,7 +1288,21 @@ export declare const json: (input: {
|
|
|
1229
1288
|
export declare const jsonError: (error: unknown, okfitVersion: string, distribution?: Distribution) => JsonErrorEnvelope;
|
|
1230
1289
|
//#endregion
|
|
1231
1290
|
//#region src/render/query.d.ts
|
|
1232
|
-
/**
|
|
1291
|
+
/**
|
|
1292
|
+
* Why a human verification no longer binds, as the wire reports it. `edited_by`
|
|
1293
|
+
* and `edited_at` are the latest human entry's actor and instant, `null` when
|
|
1294
|
+
* the drift has no such entry to name.
|
|
1295
|
+
*
|
|
1296
|
+
* @public
|
|
1297
|
+
*/
|
|
1298
|
+
export declare const TrustDrift: Schema.Struct<{
|
|
1299
|
+
readonly reason: Schema.Literals<readonly ["content-changed", "unbound", "entry-superseded", "actor-not-allowed"]>;
|
|
1300
|
+
readonly edited_by: Schema.NullOr<Schema.String>;
|
|
1301
|
+
readonly edited_at: Schema.NullOr<Schema.String>;
|
|
1302
|
+
}>;
|
|
1303
|
+
/** @public */
|
|
1304
|
+
export type TrustDrift = typeof TrustDrift.Type;
|
|
1305
|
+
/** The ten-field shape every list-like query result carries: identity plus the trust signal (N-16). @public */
|
|
1233
1306
|
export declare const ConceptSummary: Schema.Struct<{
|
|
1234
1307
|
readonly id: Schema.String;
|
|
1235
1308
|
readonly type: Schema.String;
|
|
@@ -1238,11 +1311,24 @@ export declare const ConceptSummary: Schema.Struct<{
|
|
|
1238
1311
|
readonly status: Schema.Literals<readonly ["draft", "stable", "deprecated"]>;
|
|
1239
1312
|
readonly tags: Schema.$Array<Schema.String>;
|
|
1240
1313
|
readonly path: Schema.String;
|
|
1314
|
+
readonly tier: Schema.Literals<readonly ["unverified", "machine-confirmed", "human-reviewed"]>;
|
|
1315
|
+
readonly integrity: Schema.Literals<readonly ["current", "drifted", "none"]>;
|
|
1316
|
+
readonly stale: Schema.Boolean;
|
|
1241
1317
|
}>;
|
|
1242
1318
|
/** @public */
|
|
1243
1319
|
export type ConceptSummary = typeof ConceptSummary.Type;
|
|
1244
|
-
/** Project one loaded concept into its summary. @public */
|
|
1245
|
-
export declare const toConceptSummary: (concept: LoadedConcept) => ConceptSummary;
|
|
1320
|
+
/** Project one loaded concept and its trust signal into its summary. @public */
|
|
1321
|
+
export declare const toConceptSummary: (concept: LoadedConcept, signal: ConceptSignal) => ConceptSummary;
|
|
1322
|
+
/**
|
|
1323
|
+
* The signal `Trust.signals` computed for a concept id. Every loaded concept has
|
|
1324
|
+
* one, so a missing entry is a defect (the map and the bundle disagree), and this
|
|
1325
|
+
* dies with a message naming the id rather than casting `undefined` through.
|
|
1326
|
+
*
|
|
1327
|
+
* @public
|
|
1328
|
+
*/
|
|
1329
|
+
export declare const signalFor: (signals: ReadonlyMap<string, ConceptSignal>, id: string) => ConceptSignal;
|
|
1330
|
+
/** The wire drift of a signal, or `null` when its integrity is not drifted. @public */
|
|
1331
|
+
export declare const toTrustDrift: (signal: ConceptSignal) => TrustDrift | null;
|
|
1246
1332
|
/** `okfit query list --format json`'s envelope, schema 1, snake_case. @public */
|
|
1247
1333
|
export declare const QueryListEnvelope: Schema.Struct<{
|
|
1248
1334
|
readonly schema: Schema.Literal<1>;
|
|
@@ -1261,6 +1347,9 @@ export declare const QueryListEnvelope: Schema.Struct<{
|
|
|
1261
1347
|
readonly status: Schema.Literals<readonly ["draft", "stable", "deprecated"]>;
|
|
1262
1348
|
readonly tags: Schema.$Array<Schema.String>;
|
|
1263
1349
|
readonly path: Schema.String;
|
|
1350
|
+
readonly tier: Schema.Literals<readonly ["unverified", "machine-confirmed", "human-reviewed"]>;
|
|
1351
|
+
readonly integrity: Schema.Literals<readonly ["current", "drifted", "none"]>;
|
|
1352
|
+
readonly stale: Schema.Boolean;
|
|
1264
1353
|
}>>;
|
|
1265
1354
|
}>;
|
|
1266
1355
|
/** @public */
|
|
@@ -1291,6 +1380,14 @@ export declare const QueryGetEnvelope: Schema.Struct<{
|
|
|
1291
1380
|
readonly status: Schema.Literals<readonly ["draft", "stable", "deprecated"]>;
|
|
1292
1381
|
readonly tags: Schema.$Array<Schema.String>;
|
|
1293
1382
|
readonly path: Schema.String;
|
|
1383
|
+
readonly tier: Schema.Literals<readonly ["unverified", "machine-confirmed", "human-reviewed"]>;
|
|
1384
|
+
readonly integrity: Schema.Literals<readonly ["current", "drifted", "none"]>;
|
|
1385
|
+
readonly stale: Schema.Boolean;
|
|
1386
|
+
readonly drift: Schema.NullOr<Schema.Struct<{
|
|
1387
|
+
readonly reason: Schema.Literals<readonly ["content-changed", "unbound", "entry-superseded", "actor-not-allowed"]>;
|
|
1388
|
+
readonly edited_by: Schema.NullOr<Schema.String>;
|
|
1389
|
+
readonly edited_at: Schema.NullOr<Schema.String>;
|
|
1390
|
+
}>>;
|
|
1294
1391
|
readonly frontmatter: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
1295
1392
|
readonly links: Schema.$Array<Schema.Struct<{
|
|
1296
1393
|
readonly to: Schema.String;
|
|
@@ -1314,6 +1411,9 @@ export declare const QueryNeighbor: Schema.Struct<{
|
|
|
1314
1411
|
readonly status: Schema.Literals<readonly ["draft", "stable", "deprecated"]>;
|
|
1315
1412
|
readonly tags: Schema.$Array<Schema.String>;
|
|
1316
1413
|
readonly path: Schema.String;
|
|
1414
|
+
readonly tier: Schema.Literals<readonly ["unverified", "machine-confirmed", "human-reviewed"]>;
|
|
1415
|
+
readonly integrity: Schema.Literals<readonly ["current", "drifted", "none"]>;
|
|
1416
|
+
readonly stale: Schema.Boolean;
|
|
1317
1417
|
}>>;
|
|
1318
1418
|
}>;
|
|
1319
1419
|
/** @public */
|
|
@@ -1339,6 +1439,9 @@ export declare const QueryNeighborsEnvelope: Schema.Struct<{
|
|
|
1339
1439
|
readonly status: Schema.Literals<readonly ["draft", "stable", "deprecated"]>;
|
|
1340
1440
|
readonly tags: Schema.$Array<Schema.String>;
|
|
1341
1441
|
readonly path: Schema.String;
|
|
1442
|
+
readonly tier: Schema.Literals<readonly ["unverified", "machine-confirmed", "human-reviewed"]>;
|
|
1443
|
+
readonly integrity: Schema.Literals<readonly ["current", "drifted", "none"]>;
|
|
1444
|
+
readonly stale: Schema.Boolean;
|
|
1342
1445
|
}>>;
|
|
1343
1446
|
}>>;
|
|
1344
1447
|
readonly incoming: Schema.$Array<Schema.Struct<{
|
|
@@ -1352,6 +1455,9 @@ export declare const QueryNeighborsEnvelope: Schema.Struct<{
|
|
|
1352
1455
|
readonly status: Schema.Literals<readonly ["draft", "stable", "deprecated"]>;
|
|
1353
1456
|
readonly tags: Schema.$Array<Schema.String>;
|
|
1354
1457
|
readonly path: Schema.String;
|
|
1458
|
+
readonly tier: Schema.Literals<readonly ["unverified", "machine-confirmed", "human-reviewed"]>;
|
|
1459
|
+
readonly integrity: Schema.Literals<readonly ["current", "drifted", "none"]>;
|
|
1460
|
+
readonly stale: Schema.Boolean;
|
|
1355
1461
|
}>>;
|
|
1356
1462
|
}>>;
|
|
1357
1463
|
}>;
|
|
@@ -1368,6 +1474,7 @@ export declare const queryListEnvelope: (input: {
|
|
|
1368
1474
|
export declare const queryGetEnvelope: (input: {
|
|
1369
1475
|
readonly okfitVersion: string;
|
|
1370
1476
|
readonly concept: ConceptSummary;
|
|
1477
|
+
readonly drift: TrustDrift | null;
|
|
1371
1478
|
readonly frontmatter: Readonly<Record<string, unknown>>;
|
|
1372
1479
|
readonly links: ReadonlyArray<QueryLink>;
|
|
1373
1480
|
readonly distribution?: Distribution;
|
|
@@ -1476,7 +1583,7 @@ type SyncMode = "generated" | "index" | "log";
|
|
|
1476
1583
|
*
|
|
1477
1584
|
* @public
|
|
1478
1585
|
*/
|
|
1479
|
-
export declare const SkipReason: Schema.Literals<readonly ["untracked", "dirty", "unborn", "generated-missing", "generated-unsupported", "log-unparseable"]>;
|
|
1586
|
+
export declare const SkipReason: Schema.Literals<readonly ["untracked", "dirty", "unborn", "generated-missing", "generated-unsupported", "integrity-unsupported", "renders-unsupported", "log-unparseable"]>;
|
|
1480
1587
|
/** @public */
|
|
1481
1588
|
export type SkipReason = typeof SkipReason.Type;
|
|
1482
1589
|
/** @public */
|
|
@@ -1501,6 +1608,8 @@ interface SyncModeResult {
|
|
|
1501
1608
|
/** Bundle-relative. `generated`'s ids have no `.md`; `index`/`log`'s paths do (design §2). */
|
|
1502
1609
|
readonly written: ReadonlyArray<string>;
|
|
1503
1610
|
readonly unchanged: ReadonlyArray<string>;
|
|
1611
|
+
/** `generated` mode only: ids whose legacy body digest moved to `integrity.generated.body`; may also be in `written`. */
|
|
1612
|
+
readonly migrated: ReadonlyArray<string>;
|
|
1504
1613
|
readonly skipped: ReadonlyArray<{
|
|
1505
1614
|
readonly id: string;
|
|
1506
1615
|
readonly reason: SkipReason;
|
|
@@ -1575,9 +1684,10 @@ export declare const SyncModeEnvelope: Schema.Struct<{
|
|
|
1575
1684
|
readonly selected: Schema.Boolean;
|
|
1576
1685
|
readonly written: Schema.$Array<Schema.String>;
|
|
1577
1686
|
readonly unchanged: Schema.$Array<Schema.String>;
|
|
1687
|
+
readonly migrated: Schema.$Array<Schema.String>;
|
|
1578
1688
|
readonly skipped: Schema.$Array<Schema.Struct<{
|
|
1579
1689
|
readonly id: Schema.String;
|
|
1580
|
-
readonly reason: Schema.Literals<readonly ["untracked", "dirty", "unborn", "generated-missing", "generated-unsupported", "log-unparseable"]>;
|
|
1690
|
+
readonly reason: Schema.Literals<readonly ["untracked", "dirty", "unborn", "generated-missing", "generated-unsupported", "integrity-unsupported", "renders-unsupported", "log-unparseable"]>;
|
|
1581
1691
|
}>>;
|
|
1582
1692
|
}>;
|
|
1583
1693
|
/** @public */
|
|
@@ -1593,7 +1703,7 @@ export declare const PublicationEnvelope: Schema.Struct<{
|
|
|
1593
1703
|
readonly written: Schema.Boolean;
|
|
1594
1704
|
readonly digests: Schema.$Array<Schema.Struct<{
|
|
1595
1705
|
readonly path: Schema.String;
|
|
1596
|
-
readonly
|
|
1706
|
+
readonly body: Schema.String;
|
|
1597
1707
|
}>>;
|
|
1598
1708
|
}>;
|
|
1599
1709
|
/** @public */
|
|
@@ -1624,27 +1734,30 @@ export declare const SyncEnvelope: Schema.Struct<{
|
|
|
1624
1734
|
readonly selected: Schema.Boolean;
|
|
1625
1735
|
readonly written: Schema.$Array<Schema.String>;
|
|
1626
1736
|
readonly unchanged: Schema.$Array<Schema.String>;
|
|
1737
|
+
readonly migrated: Schema.$Array<Schema.String>;
|
|
1627
1738
|
readonly skipped: Schema.$Array<Schema.Struct<{
|
|
1628
1739
|
readonly id: Schema.String;
|
|
1629
|
-
readonly reason: Schema.Literals<readonly ["untracked", "dirty", "unborn", "generated-missing", "generated-unsupported", "log-unparseable"]>;
|
|
1740
|
+
readonly reason: Schema.Literals<readonly ["untracked", "dirty", "unborn", "generated-missing", "generated-unsupported", "integrity-unsupported", "renders-unsupported", "log-unparseable"]>;
|
|
1630
1741
|
}>>;
|
|
1631
1742
|
}>;
|
|
1632
1743
|
readonly index: Schema.Struct<{
|
|
1633
1744
|
readonly selected: Schema.Boolean;
|
|
1634
1745
|
readonly written: Schema.$Array<Schema.String>;
|
|
1635
1746
|
readonly unchanged: Schema.$Array<Schema.String>;
|
|
1747
|
+
readonly migrated: Schema.$Array<Schema.String>;
|
|
1636
1748
|
readonly skipped: Schema.$Array<Schema.Struct<{
|
|
1637
1749
|
readonly id: Schema.String;
|
|
1638
|
-
readonly reason: Schema.Literals<readonly ["untracked", "dirty", "unborn", "generated-missing", "generated-unsupported", "log-unparseable"]>;
|
|
1750
|
+
readonly reason: Schema.Literals<readonly ["untracked", "dirty", "unborn", "generated-missing", "generated-unsupported", "integrity-unsupported", "renders-unsupported", "log-unparseable"]>;
|
|
1639
1751
|
}>>;
|
|
1640
1752
|
}>;
|
|
1641
1753
|
readonly log: Schema.Struct<{
|
|
1642
1754
|
readonly selected: Schema.Boolean;
|
|
1643
1755
|
readonly written: Schema.$Array<Schema.String>;
|
|
1644
1756
|
readonly unchanged: Schema.$Array<Schema.String>;
|
|
1757
|
+
readonly migrated: Schema.$Array<Schema.String>;
|
|
1645
1758
|
readonly skipped: Schema.$Array<Schema.Struct<{
|
|
1646
1759
|
readonly id: Schema.String;
|
|
1647
|
-
readonly reason: Schema.Literals<readonly ["untracked", "dirty", "unborn", "generated-missing", "generated-unsupported", "log-unparseable"]>;
|
|
1760
|
+
readonly reason: Schema.Literals<readonly ["untracked", "dirty", "unborn", "generated-missing", "generated-unsupported", "integrity-unsupported", "renders-unsupported", "log-unparseable"]>;
|
|
1648
1761
|
}>>;
|
|
1649
1762
|
}>;
|
|
1650
1763
|
/** Present only for `okfit sync --publication`; then the three modes are all `selected: false`. */
|
|
@@ -1653,7 +1766,7 @@ export declare const SyncEnvelope: Schema.Struct<{
|
|
|
1653
1766
|
readonly written: Schema.Boolean;
|
|
1654
1767
|
readonly digests: Schema.$Array<Schema.Struct<{
|
|
1655
1768
|
readonly path: Schema.String;
|
|
1656
|
-
readonly
|
|
1769
|
+
readonly body: Schema.String;
|
|
1657
1770
|
}>>;
|
|
1658
1771
|
}>>;
|
|
1659
1772
|
}>;
|
|
@@ -1678,8 +1791,8 @@ export declare const syncEnvelope: (input: {
|
|
|
1678
1791
|
//#region src/verify/select.d.ts
|
|
1679
1792
|
/**
|
|
1680
1793
|
* Why a candidate concept was skipped by batch selection: `"draft"` and
|
|
1681
|
-
* `"deprecated"` mirror `status`, `"already-verified"` means the actor
|
|
1682
|
-
*
|
|
1794
|
+
* `"deprecated"` mirror `status`, `"already-verified"` means the actor's
|
|
1795
|
+
* `verified` entry is still bound to the concept's current content.
|
|
1683
1796
|
*
|
|
1684
1797
|
* @public
|
|
1685
1798
|
*/
|
|
@@ -1700,11 +1813,12 @@ interface AttestableSelection {
|
|
|
1700
1813
|
/**
|
|
1701
1814
|
* Issue #138/#143: which concepts of `types` the actor may attest in one
|
|
1702
1815
|
* batch. A draft is unsettled and a deprecated concept is retired (#143), so
|
|
1703
|
-
* both are skipped before the already-verified check.
|
|
1816
|
+
* both are skipped before the already-verified check. A concept whose
|
|
1817
|
+
* verification has drifted, or is bound to another actor, is a candidate.
|
|
1704
1818
|
*
|
|
1705
1819
|
* @public
|
|
1706
1820
|
*/
|
|
1707
|
-
export declare const selectAttestable: (bundle: LoadedBundle, types: ReadonlySet<string>, actor: string) => AttestableSelection;
|
|
1821
|
+
export declare const selectAttestable: (bundle: LoadedBundle, types: ReadonlySet<string>, actor: string, signals: ReadonlyMap<string, ConceptSignal>) => AttestableSelection;
|
|
1708
1822
|
/**
|
|
1709
1823
|
* One row of the interactive verify picker: a `require_verified` concept the
|
|
1710
1824
|
* actor has not attested yet.
|
|
@@ -1720,15 +1834,26 @@ interface PickerCandidate {
|
|
|
1720
1834
|
readonly description: string | null;
|
|
1721
1835
|
/** How many `verified` entries by actors other than the current one. */
|
|
1722
1836
|
readonly otherAttestations: number;
|
|
1837
|
+
/** Whether the concept's human verification still binds its content (`none` when nobody human verified it). */
|
|
1838
|
+
readonly integrity: IntegrityState;
|
|
1839
|
+
/** Whether the concept is past its `stale_after` (or otherwise stale) at the time the rows were selected. */
|
|
1840
|
+
readonly stale: boolean;
|
|
1841
|
+
/** The concept file's bundle-relative path (`concept.path`); the loaders in `run.ts` make it absolute. */
|
|
1842
|
+
readonly path: string;
|
|
1843
|
+
/**
|
|
1844
|
+
* When `integrity.verified` was bound (ISO 8601), the time a drifted row's
|
|
1845
|
+
* preview diff is measured from; `null` when nothing is bound.
|
|
1846
|
+
*/
|
|
1847
|
+
readonly boundAt: string | null;
|
|
1723
1848
|
}
|
|
1724
1849
|
/**
|
|
1725
1850
|
* Every concept whose type sets `require_verified` that `actor` has not
|
|
1726
|
-
* attested: drafts included, deprecated concepts and the actor's own
|
|
1727
|
-
* attestations excluded. Sorted by type, then id; grouping is the caller's.
|
|
1851
|
+
* attested: drafts included, deprecated concepts and the actor's own still-bound
|
|
1852
|
+
* attestations excluded (a drifted one is offered again). Sorted by type, then id; grouping is the caller's.
|
|
1728
1853
|
*
|
|
1729
1854
|
* @public
|
|
1730
1855
|
*/
|
|
1731
|
-
export declare const selectPickerCandidates: (bundle: LoadedBundle, config: OkfitConfig, actor: string) => ReadonlyArray<PickerCandidate>;
|
|
1856
|
+
export declare const selectPickerCandidates: (bundle: LoadedBundle, config: OkfitConfig, actor: string, signals: ReadonlyMap<string, ConceptSignal>) => ReadonlyArray<PickerCandidate>;
|
|
1732
1857
|
/**
|
|
1733
1858
|
* Issue #228: the picker rows for `okfit stale --verify`: one per stale item,
|
|
1734
1859
|
* any type, deprecated concepts excluded. Unlike {@link selectPickerCandidates}
|
|
@@ -1738,7 +1863,7 @@ export declare const selectPickerCandidates: (bundle: LoadedBundle, config: Okfi
|
|
|
1738
1863
|
*
|
|
1739
1864
|
* @public
|
|
1740
1865
|
*/
|
|
1741
|
-
export declare const selectStaleCandidates: (bundle: LoadedBundle, items: ReadonlyArray<StaleConcept>, actor: string) => ReadonlyArray<PickerCandidate>;
|
|
1866
|
+
export declare const selectStaleCandidates: (bundle: LoadedBundle, items: ReadonlyArray<StaleConcept>, actor: string, signals: ReadonlyMap<string, ConceptSignal>) => ReadonlyArray<PickerCandidate>;
|
|
1742
1867
|
/**
|
|
1743
1868
|
* The batch type-resolution rule shared by `runVerifyBatch` and any future
|
|
1744
1869
|
* interactive picker: explicit `types` must each be declared in
|
|
@@ -1779,6 +1904,8 @@ export declare const VerifyEnvelope: Schema.Struct<{
|
|
|
1779
1904
|
readonly from: Schema.NullOr<Schema.Literals<readonly ["draft", "stable", "deprecated"]>>;
|
|
1780
1905
|
readonly to: Schema.Literals<readonly ["stable", "draft"]>;
|
|
1781
1906
|
}>>;
|
|
1907
|
+
/** Why the prior human verification no longer bound the concept; absent when it did not drift. */
|
|
1908
|
+
readonly prior_integrity: Schema.optionalKey<Schema.Literals<readonly ["content-changed", "unbound", "entry-superseded", "actor-not-allowed"]>>;
|
|
1782
1909
|
readonly dry_run: Schema.Boolean;
|
|
1783
1910
|
readonly exit_code: Schema.Literal<0>;
|
|
1784
1911
|
}>;
|
|
@@ -1803,6 +1930,8 @@ export declare const verifyEnvelope: (input: {
|
|
|
1803
1930
|
readonly from: Status | null;
|
|
1804
1931
|
readonly to: "stable" | "draft";
|
|
1805
1932
|
} | null;
|
|
1933
|
+
/** The drift reason the prior verification had, when it had drifted. */
|
|
1934
|
+
readonly priorIntegrity?: DriftReason | null;
|
|
1806
1935
|
readonly distribution?: Distribution;
|
|
1807
1936
|
}) => VerifyEnvelope;
|
|
1808
1937
|
/**
|
|
@@ -1857,6 +1986,46 @@ export declare const verifyBatchEnvelope: (input: {
|
|
|
1857
1986
|
readonly dryRun: boolean;
|
|
1858
1987
|
readonly distribution?: Distribution;
|
|
1859
1988
|
}) => VerifyBatchEnvelope;
|
|
1989
|
+
/**
|
|
1990
|
+
* `okfit verify --revoke`'s success envelope, schema 1, snake_case. `removed`
|
|
1991
|
+
* lists the `at` of every verification entry taken out (in list order);
|
|
1992
|
+
* `binding_cleared` says whether `integrity.verified` went with them.
|
|
1993
|
+
*
|
|
1994
|
+
* @public
|
|
1995
|
+
*/
|
|
1996
|
+
export declare const RevokeEnvelope: Schema.Struct<{
|
|
1997
|
+
readonly schema: Schema.Literal<1>;
|
|
1998
|
+
readonly okfit_version: Schema.String;
|
|
1999
|
+
readonly engine_version: Schema.String;
|
|
2000
|
+
readonly distribution: Schema.NullOr<Schema.Struct<{
|
|
2001
|
+
readonly name: Schema.String;
|
|
2002
|
+
readonly version: Schema.String;
|
|
2003
|
+
}>>;
|
|
2004
|
+
readonly id: Schema.String;
|
|
2005
|
+
readonly path: Schema.String;
|
|
2006
|
+
readonly revoked_by: Schema.String;
|
|
2007
|
+
readonly removed: Schema.$Array<Schema.String>;
|
|
2008
|
+
readonly binding_cleared: Schema.Boolean;
|
|
2009
|
+
readonly dry_run: Schema.Boolean;
|
|
2010
|
+
readonly exit_code: Schema.Literal<0>;
|
|
2011
|
+
}>;
|
|
2012
|
+
/** @public */
|
|
2013
|
+
export type RevokeEnvelope = typeof RevokeEnvelope.Type;
|
|
2014
|
+
/**
|
|
2015
|
+
* `path` is already the display form, as for {@link verifyEnvelope}.
|
|
2016
|
+
*
|
|
2017
|
+
* @public
|
|
2018
|
+
*/
|
|
2019
|
+
export declare const revokeEnvelope: (input: {
|
|
2020
|
+
readonly okfitVersion: string;
|
|
2021
|
+
readonly id: string;
|
|
2022
|
+
readonly path: string;
|
|
2023
|
+
readonly by: string;
|
|
2024
|
+
readonly removed: ReadonlyArray<string>;
|
|
2025
|
+
readonly bindingCleared: boolean;
|
|
2026
|
+
readonly dryRun: boolean;
|
|
2027
|
+
readonly distribution?: Distribution;
|
|
2028
|
+
}) => RevokeEnvelope;
|
|
1860
2029
|
//#endregion
|
|
1861
2030
|
//#region src/session/BundleSession.d.ts
|
|
1862
2031
|
/**
|
|
@@ -1924,6 +2093,8 @@ interface BundleSessionShape {
|
|
|
1924
2093
|
readonly revalidate: (options: RevalidateOptions) => Effect.Effect<RevalidateResult, RevalidateError>;
|
|
1925
2094
|
readonly bundle: () => Effect.Effect<Option.Option<LoadedBundle>>;
|
|
1926
2095
|
readonly graph: () => Effect.Effect<Option.Option<LinkGraph>>;
|
|
2096
|
+
/** Every concept's trust signal from the last revalidate, keyed by concept id. */
|
|
2097
|
+
readonly signals: () => Effect.Effect<Option.Option<ReadonlyMap<string, ConceptSignal>>>;
|
|
1927
2098
|
readonly config: () => OkfitConfig;
|
|
1928
2099
|
}
|
|
1929
2100
|
declare const BundleSession_base: Context.ServiceClass<BundleSession, "@okfit/engine/BundleSession", BundleSessionShape>;
|
|
@@ -2020,7 +2191,7 @@ export declare class NotAPublicationError extends NotAPublicationError_base {
|
|
|
2020
2191
|
get message(): string;
|
|
2021
2192
|
}
|
|
2022
2193
|
/**
|
|
2023
|
-
* Restamps one Publication's `renders[].
|
|
2194
|
+
* Restamps one Publication's `renders[].body` digests from the current
|
|
2024
2195
|
* body of each rendered source concept, writing the Publication file
|
|
2025
2196
|
* atomically unless `dryRun`. `written` is whether the text changed (so a
|
|
2026
2197
|
* `dryRun` that would change the file reports `true` without writing).
|
|
@@ -2034,6 +2205,26 @@ export declare const stampPublication: (options: {
|
|
|
2034
2205
|
readonly dryRun: boolean;
|
|
2035
2206
|
}) => Effect.Effect<PublicationEnvelope, PublicationNotFoundError | NotAPublicationError | BundleLoadError | YamlParseError | UnsupportedFrontmatterError | PlatformError.PlatformError, FileSystem.FileSystem | Path.Path | Crypto.Crypto>;
|
|
2036
2207
|
//#endregion
|
|
2208
|
+
//#region src/trust/run.d.ts
|
|
2209
|
+
/** @public */
|
|
2210
|
+
interface ContextTrustOptions {
|
|
2211
|
+
readonly bundleRoot: string;
|
|
2212
|
+
/** The merged config the bundle was loaded under; its `[actors].humans` gates the drift signal. */
|
|
2213
|
+
readonly config: OkfitConfig;
|
|
2214
|
+
/** `OKFIT_NOW` or `DateTime.now`, from the caller's own `Now` service. */
|
|
2215
|
+
readonly now: DateTime.Utc;
|
|
2216
|
+
}
|
|
2217
|
+
/**
|
|
2218
|
+
* The opt-in half of `context`: load the bundle and fold `Trust.signals`
|
|
2219
|
+
* into counts plus the first five drifted and stale ids. Kept apart from
|
|
2220
|
+
* {@link runContext} so the default path never loads the bundle; only
|
|
2221
|
+
* `--trust` pays for it. Hashing happens inside `Trust.signals`, and only
|
|
2222
|
+
* for concepts a human verification binds.
|
|
2223
|
+
*
|
|
2224
|
+
* @public
|
|
2225
|
+
*/
|
|
2226
|
+
export declare const runContextTrust: (options: ContextTrustOptions) => Effect.Effect<ContextTrust, BundleLoadError | PlatformError.PlatformError, FileSystem.FileSystem | Path.Path | Crypto.Crypto>;
|
|
2227
|
+
//#endregion
|
|
2037
2228
|
//#region src/validate/run.d.ts
|
|
2038
2229
|
declare const Now_base: Context.ServiceClass<Now, "@okfit/engine/Now", DateTime.Utc>;
|
|
2039
2230
|
/**
|
|
@@ -2064,7 +2255,8 @@ interface RunOptions {
|
|
|
2064
2255
|
readonly now: DateTime.Utc;
|
|
2065
2256
|
/**
|
|
2066
2257
|
* S-31: skip `Provenance.lint`'s git TIER (tier 2, the git-derived date
|
|
2067
|
-
* comparison for concepts with no recorded
|
|
2258
|
+
* comparison for concepts with no recorded body digest: neither
|
|
2259
|
+
* `integrity.generated.body` nor a legacy `generated.body_sha256`)
|
|
2068
2260
|
* for this one invocation, without touching the project's `[lint]`
|
|
2069
2261
|
* table. `commands/validate.ts` threads `--skip-provenance` here; the
|
|
2070
2262
|
* PostToolUse hook passes the flag so an edit-time `validate` stays
|
|
@@ -2083,6 +2275,8 @@ interface RunResult {
|
|
|
2083
2275
|
readonly report: ValidationReport;
|
|
2084
2276
|
/** `[]` when `profile` is `None`. */
|
|
2085
2277
|
readonly profileDiagnostics: ReadonlyArray<ProfileDiagnostic>;
|
|
2278
|
+
/** The trust signal of every concept, keyed by concept id; computed once and shared with `Trust.lint`. */
|
|
2279
|
+
readonly signals: ReadonlyMap<string, ConceptSignal>;
|
|
2086
2280
|
}
|
|
2087
2281
|
/**
|
|
2088
2282
|
* Load, validate both tiers, run the profile check, then — UNLESS the
|
|
@@ -2091,7 +2285,7 @@ interface RunResult {
|
|
|
2091
2285
|
* HERE, in `run`: a bundle configured `off` never calls `Provenance.lint`
|
|
2092
2286
|
* at all. `options.skipProvenance` is no longer that gate — it is threaded
|
|
2093
2287
|
* through as `Provenance.lint`'s `skipGitTier` option instead, so tier 1
|
|
2094
|
-
* (the pure, in-memory
|
|
2288
|
+
* (the pure, in-memory recorded-body-digest comparison) still runs and
|
|
2095
2289
|
* still reports drift even when `skipProvenance` is `true`; only tier 2
|
|
2096
2290
|
* (the git-derived date comparison, for concepts with no recorded digest)
|
|
2097
2291
|
* is skipped, and with it the only git spawn `Provenance.lint` can make
|
|
@@ -2101,7 +2295,7 @@ interface RunResult {
|
|
|
2101
2295
|
* the same `report.lint` array every other core lint diagnostic already
|
|
2102
2296
|
* does.
|
|
2103
2297
|
*
|
|
2104
|
-
* It then appends `lintResources`, `Publications.lint` (`publication-drift`
|
|
2298
|
+
* It then appends `Trust.lint` (`verified-drift`, which gates itself on its own severity), `lintResources`, `Publications.lint` (`publication-drift`
|
|
2105
2299
|
* and `publication-orphan`, only under the `software-project` profile) and `lintSurfaces` (`surface-unmatched`), each
|
|
2106
2300
|
* of which gates itself on its own severity.
|
|
2107
2301
|
*
|
|
@@ -2116,6 +2310,64 @@ interface RunResult {
|
|
|
2116
2310
|
*/
|
|
2117
2311
|
export declare const run: (options: RunOptions) => Effect.Effect<RunResult, BundleLoadError | GitHistoryError | GitCommandError | UnknownRefError | PlatformError.PlatformError, FileSystem.FileSystem | Path.Path | Git | GitHistory | Crypto.Crypto>;
|
|
2118
2312
|
//#endregion
|
|
2313
|
+
//#region src/verify/diff.d.ts
|
|
2314
|
+
/**
|
|
2315
|
+
* What changed in a concept file since a human last verified it.
|
|
2316
|
+
*
|
|
2317
|
+
* `diff` carries the patch from the baseline commit to the working tree (so it
|
|
2318
|
+
* includes uncommitted edits); `no-baseline` says why there is none: the
|
|
2319
|
+
* verification was never bound (`unbound`), no commit touching the file is at or
|
|
2320
|
+
* before the bound time (`no-commit-before`), or the file is outside a git
|
|
2321
|
+
* repository (`not-a-repository`).
|
|
2322
|
+
*
|
|
2323
|
+
* @public
|
|
2324
|
+
*/
|
|
2325
|
+
type ChangeSince = {
|
|
2326
|
+
readonly _tag: "diff";
|
|
2327
|
+
readonly baseline: string;
|
|
2328
|
+
readonly patch: string;
|
|
2329
|
+
} | {
|
|
2330
|
+
readonly _tag: "no-baseline";
|
|
2331
|
+
readonly reason: "unbound" | "no-commit-before" | "not-a-repository";
|
|
2332
|
+
};
|
|
2333
|
+
/**
|
|
2334
|
+
* The patch between the version of `file` a human verified (`at`) and what is
|
|
2335
|
+
* on disk now.
|
|
2336
|
+
*
|
|
2337
|
+
* The baseline is the newest commit touching the file whose committer date is
|
|
2338
|
+
* at or before `at`; the patch is `git diff <baseline> -- <file>`.
|
|
2339
|
+
*
|
|
2340
|
+
* Git access: `@effected/git`'s `Git.log` (scoped to the file, newest first,
|
|
2341
|
+
* filtered here on `committedAt`) finds the baseline. `Git.log` has no `until`,
|
|
2342
|
+
* and no `Git` member returns a patch (`show` returns a blob, `nameStatus` only
|
|
2343
|
+
* paths), so the diff itself runs `git diff` through `effect/process`'s
|
|
2344
|
+
* `ChildProcessSpawner`, the same spawner `Git.layer` is built on. Spawn
|
|
2345
|
+
* failure maps onto `Git`'s own `GitCommandError`.
|
|
2346
|
+
*
|
|
2347
|
+
* @param options - `file` is the absolute path of the concept file; `at` is the
|
|
2348
|
+
* time the binding recorded.
|
|
2349
|
+
* @public
|
|
2350
|
+
*/
|
|
2351
|
+
export declare const changeSince: (options: {
|
|
2352
|
+
readonly file: string;
|
|
2353
|
+
readonly at: DateTime.Utc;
|
|
2354
|
+
}) => Effect.Effect<{
|
|
2355
|
+
_tag: "no-baseline";
|
|
2356
|
+
reason: "not-a-repository";
|
|
2357
|
+
baseline?: never;
|
|
2358
|
+
patch?: never;
|
|
2359
|
+
} | {
|
|
2360
|
+
_tag: "no-baseline";
|
|
2361
|
+
reason: "no-commit-before";
|
|
2362
|
+
baseline?: never;
|
|
2363
|
+
patch?: never;
|
|
2364
|
+
} | {
|
|
2365
|
+
reason?: never;
|
|
2366
|
+
_tag: "diff";
|
|
2367
|
+
baseline: string;
|
|
2368
|
+
patch: string;
|
|
2369
|
+
}, GitCommandError, ChildProcessSpawner.ChildProcessSpawner | Git | Path.Path>;
|
|
2370
|
+
//#endregion
|
|
2119
2371
|
//#region src/verify/run.d.ts
|
|
2120
2372
|
/** @internal */
|
|
2121
2373
|
interface VerifyOptions {
|
|
@@ -2155,6 +2407,10 @@ interface VerifyResult {
|
|
|
2155
2407
|
} | null;
|
|
2156
2408
|
/** The exact status bytes spliced, or `null` when no status edit was made. */
|
|
2157
2409
|
readonly statusFragment: string | null;
|
|
2410
|
+
/** The content digest `integrity.verified` was bound to; the digest of the file before AND after the edit. */
|
|
2411
|
+
readonly content: string;
|
|
2412
|
+
/** Why the concept's prior human verification no longer bound it, or `null` when it did not drift. */
|
|
2413
|
+
readonly priorDrift: DriftReason | null;
|
|
2158
2414
|
}
|
|
2159
2415
|
/**
|
|
2160
2416
|
* Issue #138: options for {@link runVerifyBatch}. `types` restricts the
|
|
@@ -2218,12 +2474,96 @@ export declare const runVerify: (options: VerifyOptions) => Effect.Effect<{
|
|
|
2218
2474
|
to: "draft" | "stable";
|
|
2219
2475
|
} | null;
|
|
2220
2476
|
statusFragment: string | null;
|
|
2221
|
-
|
|
2477
|
+
content: string;
|
|
2478
|
+
priorDrift: "actor-not-allowed" | "content-changed" | "entry-superseded" | "unbound" | null;
|
|
2479
|
+
}, import("effect/PlatformError").PlatformError | VerifyConceptNotFoundError | VerifyUnsupportedFrontmatterError | import("@effected/yaml").YamlParseError | import("@okfit/core").BundleLoadError | import("@okfit/profiles").VerifierError, import("effect/Crypto").Crypto | FileSystem.FileSystem | import("@effected/git").Git | Path.Path>;
|
|
2480
|
+
/**
|
|
2481
|
+
* What {@link inspectDrift} found out about one concept before a re-verify.
|
|
2482
|
+
*
|
|
2483
|
+
* @internal
|
|
2484
|
+
*/
|
|
2485
|
+
interface DriftInspection {
|
|
2486
|
+
readonly id: string;
|
|
2487
|
+
/** Absolute path of the concept file. */
|
|
2488
|
+
readonly absolutePath: string;
|
|
2489
|
+
/** Why its human verification no longer binds, or `null` when it does not drift. */
|
|
2490
|
+
readonly drift: DriftReason | null;
|
|
2491
|
+
/** When `integrity.verified` was bound, the time the shown patch is measured from; absent when unbound. */
|
|
2492
|
+
readonly boundAt?: DateTime.Utc;
|
|
2493
|
+
}
|
|
2494
|
+
/**
|
|
2495
|
+
* Read-only: is the concept's prior human verification drifted, and if so from
|
|
2496
|
+
* when was it bound? The CLI asks this before `runVerify` so it can show what
|
|
2497
|
+
* changed. Writes nothing.
|
|
2498
|
+
*
|
|
2499
|
+
* @internal
|
|
2500
|
+
*/
|
|
2501
|
+
export declare const inspectDrift: (options: {
|
|
2502
|
+
readonly id: string;
|
|
2503
|
+
readonly bundleRoot: string;
|
|
2504
|
+
readonly config: OkfitConfig;
|
|
2505
|
+
readonly now: DateTime.Utc;
|
|
2506
|
+
}) => Effect.Effect<{
|
|
2507
|
+
id: ConceptId;
|
|
2508
|
+
absolutePath: string;
|
|
2509
|
+
drift: "actor-not-allowed" | "content-changed" | "entry-superseded" | "unbound" | null;
|
|
2510
|
+
boundAt?: DateTime.Utc;
|
|
2511
|
+
}, import("effect/PlatformError").PlatformError | VerifyConceptNotFoundError | import("@okfit/core").BundleLoadError, import("effect/Crypto").Crypto | FileSystem.FileSystem | Path.Path>;
|
|
2512
|
+
/**
|
|
2513
|
+
* Options for {@link runRevoke}.
|
|
2514
|
+
*
|
|
2515
|
+
* @internal
|
|
2516
|
+
*/
|
|
2517
|
+
interface RevokeOptions {
|
|
2518
|
+
readonly id: string;
|
|
2519
|
+
readonly bundleRoot: string;
|
|
2520
|
+
readonly projectRoot: string;
|
|
2521
|
+
readonly config: OkfitConfig;
|
|
2522
|
+
readonly dryRun: boolean;
|
|
2523
|
+
}
|
|
2524
|
+
/**
|
|
2525
|
+
* What {@link runRevoke} removed (or, under a dry run, would remove).
|
|
2526
|
+
*
|
|
2527
|
+
* @internal
|
|
2528
|
+
*/
|
|
2529
|
+
interface RevokeResult {
|
|
2530
|
+
readonly id: string;
|
|
2531
|
+
readonly bundleRoot: string;
|
|
2532
|
+
readonly conceptPath: string;
|
|
2533
|
+
/** The resolved actor whose entries were removed. */
|
|
2534
|
+
readonly by: string;
|
|
2535
|
+
/** The encoded `at` of every removed entry, in list order. */
|
|
2536
|
+
readonly removed: ReadonlyArray<string>;
|
|
2537
|
+
/** Whether `integrity.verified` (bound to this actor) was removed too. */
|
|
2538
|
+
readonly bindingCleared: boolean;
|
|
2539
|
+
readonly dryRun: boolean;
|
|
2540
|
+
}
|
|
2541
|
+
/**
|
|
2542
|
+
* `okfit verify --revoke`: removes every `verified` entry by the resolved
|
|
2543
|
+
* human actor (the same git identity `verify` records) and, when
|
|
2544
|
+
* `integrity.verified` is bound to that actor, that slot too, deleting the
|
|
2545
|
+
* whole `integrity` block only when nothing else is left in it. Every cut is a
|
|
2546
|
+
* byte-precise splice; an unsupported `verified` or `integrity` shape fails
|
|
2547
|
+
* closed with the file untouched, and an actor with no entry fails
|
|
2548
|
+
* `VerifyNothingToRevokeError`. Another actor's entries and binding are never
|
|
2549
|
+
* touched, so they then read as `entry-superseded` or unbound by themselves.
|
|
2550
|
+
*
|
|
2551
|
+
* @internal
|
|
2552
|
+
*/
|
|
2553
|
+
export declare const runRevoke: (options: RevokeOptions) => Effect.Effect<{
|
|
2554
|
+
id: ConceptId;
|
|
2555
|
+
bundleRoot: string;
|
|
2556
|
+
conceptPath: string;
|
|
2557
|
+
by: Actor;
|
|
2558
|
+
removed: string[];
|
|
2559
|
+
bindingCleared: boolean;
|
|
2560
|
+
dryRun: boolean;
|
|
2561
|
+
}, import("effect/PlatformError").PlatformError | VerifyConceptNotFoundError | VerifyNothingToRevokeError | VerifyUnsupportedFrontmatterError | import("@effected/yaml").YamlParseError | import("@okfit/core").BundleLoadError | import("@okfit/profiles").VerifierError, FileSystem.FileSystem | import("@effected/git").Git | Path.Path>;
|
|
2222
2562
|
/**
|
|
2223
2563
|
* Issue #138. Attests every concept selected by `options.types` (or, when
|
|
2224
2564
|
* empty, every type whose declaration sets `require_verified = true`) that
|
|
2225
|
-
* is not a draft, is not deprecated (#143) and
|
|
2226
|
-
* resolved actor. Every candidate is located FIRST -- an unsupported
|
|
2565
|
+
* is not a draft, is not deprecated (#143) and whose `verified` entry by the
|
|
2566
|
+
* resolved actor does not already bind its current content (`Trust.signals`). Every candidate is located FIRST -- an unsupported
|
|
2227
2567
|
* `verified` shape on any one of them fails the whole batch with nothing
|
|
2228
2568
|
* written, mirroring `runVerify`'s own fail-closed rule at batch scale.
|
|
2229
2569
|
*
|
|
@@ -2243,7 +2583,7 @@ export declare const runVerifyBatch: (options: VerifyBatchOptions) => Effect.Eff
|
|
|
2243
2583
|
readonly id: string;
|
|
2244
2584
|
readonly reason: VerifyBatchSkipReason;
|
|
2245
2585
|
}[];
|
|
2246
|
-
}, import("effect/PlatformError").PlatformError | VerifySelectionError | VerifyUnsupportedFrontmatterError | import("@effected/yaml").YamlParseError | import("@okfit/core").BundleLoadError | import("@okfit/profiles").
|
|
2586
|
+
}, import("effect/PlatformError").PlatformError | VerifySelectionError | VerifyUnsupportedFrontmatterError | import("@effected/yaml").YamlParseError | import("@okfit/core").BundleLoadError | import("@okfit/profiles").VerifierError, import("effect/Crypto").Crypto | FileSystem.FileSystem | import("@effected/git").Git | Path.Path>;
|
|
2247
2587
|
/**
|
|
2248
2588
|
* Issue #214: options for {@link runVerifyIds}.
|
|
2249
2589
|
*
|
|
@@ -2291,7 +2631,7 @@ export declare const runVerifyIds: (options: VerifyIdsOptions) => Effect.Effect<
|
|
|
2291
2631
|
fragment: string;
|
|
2292
2632
|
}[];
|
|
2293
2633
|
skipped: never[];
|
|
2294
|
-
}, import("effect/PlatformError").PlatformError | VerifyConceptNotFoundError | VerifyUnsupportedFrontmatterError | import("@effected/yaml").YamlParseError | import("@okfit/core").BundleLoadError | import("@okfit/profiles").
|
|
2634
|
+
}, import("effect/PlatformError").PlatformError | VerifyConceptNotFoundError | VerifyUnsupportedFrontmatterError | import("@effected/yaml").YamlParseError | import("@okfit/core").BundleLoadError | import("@okfit/profiles").VerifierError, import("effect/Crypto").Crypto | FileSystem.FileSystem | import("@effected/git").Git | Path.Path>;
|
|
2295
2635
|
/**
|
|
2296
2636
|
* Options for {@link loadPickerCandidates}.
|
|
2297
2637
|
*
|
|
@@ -2312,7 +2652,7 @@ interface PickerCandidatesOptions {
|
|
|
2312
2652
|
export declare const loadPickerCandidates: (options: PickerCandidatesOptions) => Effect.Effect<{
|
|
2313
2653
|
by: Actor;
|
|
2314
2654
|
candidates: readonly PickerCandidate[];
|
|
2315
|
-
}, import("@okfit/core").BundleLoadError | import("@okfit/profiles").
|
|
2655
|
+
}, import("effect/PlatformError").PlatformError | import("@okfit/core").BundleLoadError | import("@okfit/profiles").VerifierError, import("effect/Crypto").Crypto | FileSystem.FileSystem | import("@effected/git").Git | Path.Path>;
|
|
2316
2656
|
/**
|
|
2317
2657
|
* Issue #228: as {@link loadPickerCandidates}, but the rows are the concepts
|
|
2318
2658
|
* stale at `now` (any type, the actor's own attestations included), for
|
|
@@ -2325,7 +2665,18 @@ export declare const loadStaleCandidates: (options: PickerCandidatesOptions & {
|
|
|
2325
2665
|
}) => Effect.Effect<{
|
|
2326
2666
|
by: Actor;
|
|
2327
2667
|
candidates: readonly PickerCandidate[];
|
|
2328
|
-
}, import("@okfit/core").BundleLoadError | import("@okfit/profiles").
|
|
2668
|
+
}, import("effect/PlatformError").PlatformError | import("@okfit/core").BundleLoadError | import("@okfit/profiles").VerifierError, import("effect/Crypto").Crypto | FileSystem.FileSystem | import("@effected/git").Git | Path.Path>;
|
|
2669
|
+
/**
|
|
2670
|
+
* The verify picker's diff previews: for each drifted candidate, in candidate
|
|
2671
|
+
* order and one at a time, what changed in its file since its verification was
|
|
2672
|
+
* bound ({@link changeSince}). A candidate with no binding is `no-baseline`
|
|
2673
|
+
* `unbound` without touching git, and a git failure reading the history is
|
|
2674
|
+
* `no-baseline` `not-a-repository`, so a preview never fails the picker. Rows
|
|
2675
|
+
* that are not drifted get no entry. Reads only.
|
|
2676
|
+
*
|
|
2677
|
+
* @public
|
|
2678
|
+
*/
|
|
2679
|
+
export declare const loadPreviews: (candidates: readonly PickerCandidate[]) => Effect.Effect<ReadonlyMap<string, ChangeSince>, never, import("effect/process/ChildProcessSpawner").ChildProcessSpawner | import("@effected/git").Git | Path.Path>;
|
|
2329
2680
|
//#endregion
|
|
2330
2681
|
//#region src/version.d.ts
|
|
2331
2682
|
/**
|
|
@@ -2342,5 +2693,5 @@ export declare const loadStaleCandidates: (options: PickerCandidatesOptions & {
|
|
|
2342
2693
|
*/
|
|
2343
2694
|
export declare const ENGINE_VERSION: string;
|
|
2344
2695
|
//#endregion
|
|
2345
|
-
export type { AttestableSelection, BundleSessionOptions, BundleSessionServices, BundleSessionShape, ConceptFilter, ConceptLink, ConceptNeighbor, ContextResult, ContextRunOptions, DiagnosticSource, DiscoveredConfig, Distribution, DocumentInput, ExternalReferencesShape, GraphRunOptions, GraphRunResult, OverlayDocument, OverlayDocumentsShape, PendingWrite, PickerCandidate, PickerCandidatesOptions, RenderedDiagnostic, ResolveProjectConfigInput, ResolvedProjectConfig, RevalidateError, RevalidateOptions, RevalidateResult, RevalidateTier, RunOptions, RunResult, ScaffoldFile, ScaffoldOptions, StaleRunOptions, StaleRunResult, SyncMode, SyncModeResult, SyncOptions, SyncPlan, SyncResult, Tally, VerifyBatchOptions, VerifyBatchResult, VerifyBatchSkipReason, VerifyIdsOptions, VerifyOptions, VerifyResult, WatchedFilesOutcome };
|
|
2696
|
+
export type { AttestableSelection, BundleSessionOptions, BundleSessionServices, BundleSessionShape, ChangeSince, ConceptFilter, ConceptLink, ConceptNeighbor, ContextResult, ContextRunOptions, ContextTrustOptions, DiagnosticSource, DiscoveredConfig, Distribution, DocumentInput, DriftInspection, ExternalReferencesShape, GraphRunOptions, GraphRunResult, OverlayDocument, OverlayDocumentsShape, PendingWrite, PickerCandidate, PickerCandidatesOptions, RenderedDiagnostic, ResolveProjectConfigInput, ResolvedProjectConfig, RevalidateError, RevalidateOptions, RevalidateResult, RevalidateTier, RevokeOptions, RevokeResult, RunOptions, RunResult, ScaffoldFile, ScaffoldOptions, StaleRunOptions, StaleRunResult, SyncMode, SyncModeResult, SyncOptions, SyncPlan, SyncResult, Tally, VerifyBatchOptions, VerifyBatchResult, VerifyBatchSkipReason, VerifyIdsOptions, VerifyOptions, VerifyResult, WatchedFilesOutcome };
|
|
2346
2697
|
//# sourceMappingURL=index.d.ts.map
|