@okfit/engine 0.14.1 → 0.16.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/index.d.ts CHANGED
@@ -1,13 +1,14 @@
1
- import { Actor, BundleLoadError, ConceptId, Diagnostic, DiagnosticRange, DiagnosticSeverity, GraphLink, GraphNode, GraphNodeKind, LinkGraph, LoadedBundle, LoadedConcept, OkfitConfig, OkfitConfigFile, StaleConcept, Status, ValidationReport } from "@okfit/core";
1
+ import { Actor, BundleLoadError, ConceptId, Diagnostic, DiagnosticRange, DiagnosticSeverity, GraphLink, GraphNode, GraphNodeKind, LinkGraph, LoadedBundle, LoadedConcept, OkfitConfig, OkfitConfigFile, PathField, StaleConcept, Status, ValidationReport } from "@okfit/core";
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
@@ -64,7 +65,7 @@ export declare const resolveProjectRoot: (input: {
64
65
  * `<project root>/<bundle.path>`, absolute (K-2). `config` is the MERGED
65
66
  * config, so `bundle.path` is `OkfitConfig.DEFAULTS.bundle.path` (`"okf"`)
66
67
  * unless a file or profile overrode it. The bundle root is never what
67
- * `[path]` names.
68
+ * `--root` names.
68
69
  *
69
70
  * @public
70
71
  */
@@ -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", "targets-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
  /**
@@ -273,6 +289,56 @@ export declare class QuerySelectionError extends QuerySelectionError_base {
273
289
  readonly [Runtime.errorExitCode] = 64;
274
290
  get message(): string;
275
291
  }
292
+ /**
293
+ * One argument that did not resolve to a concept target.
294
+ *
295
+ * @public
296
+ */
297
+ export declare const TargetFailure: Schema.Struct<{
298
+ readonly arg: Schema.String;
299
+ readonly reason: Schema.Literals<readonly ["not-found", "ambiguous", "outside-bundle", "reserved", "not-a-concept"]>;
300
+ readonly suggestion: Schema.optionalKey<Schema.String>;
301
+ readonly candidates: Schema.optionalKey<Schema.Tuple<readonly [Schema.String, Schema.String]>>;
302
+ }>;
303
+ /** @public */
304
+ export type TargetFailure = typeof TargetFailure.Type;
305
+ declare const TargetResolutionError_base: Schema.Class<TargetResolutionError, Schema.TaggedStruct<"TargetResolutionError", {
306
+ readonly failures: Schema.$Array<Schema.Struct<{
307
+ readonly arg: Schema.String;
308
+ readonly reason: Schema.Literals<readonly ["not-found", "ambiguous", "outside-bundle", "reserved", "not-a-concept"]>;
309
+ readonly suggestion: Schema.optionalKey<Schema.String>;
310
+ readonly candidates: Schema.optionalKey<Schema.Tuple<readonly [Schema.String, Schema.String]>>;
311
+ }>>;
312
+ }>, import("effect/Cause").YieldableError>;
313
+ /**
314
+ * One or more concept targets did not resolve. Every bad argument is listed;
315
+ * nothing ran. Exit 64: a usage error.
316
+ *
317
+ * @public
318
+ */
319
+ export declare class TargetResolutionError extends TargetResolutionError_base {
320
+ readonly [Runtime.errorExitCode] = 64;
321
+ get message(): string;
322
+ }
323
+ declare const MoveError_base: Schema.Class<MoveError, Schema.TaggedStruct<"MoveError", {
324
+ readonly reason: Schema.Literals<readonly ["outside-bundle", "destination-exists", "reserved", "same-path", "invalid-name", "unrewritable", "project-file", "unloaded-files"]>;
325
+ readonly detail: Schema.optionalKey<Schema.String>;
326
+ }>, import("effect/Cause").YieldableError>;
327
+ /**
328
+ * `okfit mv` refused before writing anything. `outside-bundle`, `destination-exists`, `reserved`,
329
+ * `same-path` and `invalid-name` (whitespace in a destination path segment) name a bad destination
330
+ * (`detail` is the destination); `unrewritable` lists every link that needs rewriting for this move
331
+ * (`file: url`, one per line) whose URL text could not be located; `project-file` refuses to move the
332
+ * bundle's root project file (`detail` is its path), which must stay at the bundle root;
333
+ * `unloaded-files` lists (one per line) the bundle's Markdown files that did not load as concepts,
334
+ * whose links to the moved file could not be rewritten.
335
+ *
336
+ * @public
337
+ */
338
+ export declare class MoveError extends MoveError_base {
339
+ readonly [Runtime.errorExitCode] = 64;
340
+ get message(): string;
341
+ }
276
342
  //#endregion
277
343
  //#region src/config/layer.d.ts
278
344
  /**
@@ -301,7 +367,7 @@ export declare class QuerySelectionError extends QuerySelectionError_base {
301
367
  * `save`/`update` do not fail with `ConfigDefaultPathMissingError`; nothing
302
368
  * here sets it explicitly any more.
303
369
  *
304
- * `discoveryCwd` is `[path]` when given, else `process.cwd()` (K-2), passed
370
+ * `discoveryCwd` is `--root` when given, else `process.cwd()` (K-2), passed
305
371
  * straight through as `upwardWalk`'s own `cwd` so nothing in this module
306
372
  * reads the process.
307
373
  *
@@ -392,7 +458,7 @@ interface ResolvedProjectConfig {
392
458
  }
393
459
  /**
394
460
  * Input to {@link resolveProjectConfig}: the same three values every command
395
- * handler already has in hand (its own `[path]` argument, its own
461
+ * handler already has in hand (its own `--root` flag, its own
396
462
  * `--config` flag, and `process.cwd()`) — nothing this function needs is
397
463
  * read from `process` itself.
398
464
  *
@@ -488,28 +554,36 @@ export declare class FrontmatterEdits {
488
554
  private constructor();
489
555
  /** Edits that set top-level `status` to `status`, replacing an existing scalar or inserting after `title:` (else `type:`). */
490
556
  static readonly status: (source: string, status: Status) => Effect.Effect<ReadonlyArray<MarkdownEdit>, YamlParseError | UnsupportedFrontmatterError>;
491
- /** Edits that append one verified entry, the same splice `okfit verify` performs. */
557
+ /**
558
+ * Edits that append one verified entry and bind it with `integrity.verified`
559
+ * (`content` is the content digest of the source as passed), the same splice
560
+ * `okfit verify` performs. Only the `verified` slot of an existing `integrity`
561
+ * block is rewritten.
562
+ */
492
563
  static readonly verified: (source: string, entry: {
493
564
  readonly by: string;
494
565
  readonly at: string;
495
- }) => Effect.Effect<ReadonlyArray<MarkdownEdit>, YamlParseError | UnsupportedFrontmatterError>;
566
+ }, content: string) => Effect.Effect<ReadonlyArray<MarkdownEdit>, YamlParseError | UnsupportedFrontmatterError>;
496
567
  /**
497
- * Edits that append one verified entry AND set top-level `status`, the combined write
498
- * `okfit verify --stable` performs. A `status` scalar already equal to `status` makes no
499
- * status edit, and equal-offset inserts are merged with `status:` first. Unlike the CLI,
500
- * which reads the parsed status, this always locates `status`, so an unsupported shape
501
- * on it fails even when its value already matches.
568
+ * Edits that append one verified entry, bind it with `integrity.verified` AND set top-level
569
+ * `status`, the combined write `okfit verify --stable` performs. A `status` scalar already
570
+ * equal to `status` makes no status edit, and equal-offset inserts are merged with `status:`
571
+ * first, then `verified:`, then `integrity:`. Unlike the CLI, which reads the parsed status,
572
+ * this always locates `status`, so an unsupported shape on it fails even when its value
573
+ * already matches.
502
574
  */
503
575
  static readonly verifiedWithStatus: (source: string, entry: {
504
576
  readonly by: string;
505
577
  readonly at: string;
506
- }, status: Status) => Effect.Effect<ReadonlyArray<MarkdownEdit>, YamlParseError | UnsupportedFrontmatterError>;
578
+ }, status: Status, content: string) => Effect.Effect<ReadonlyArray<MarkdownEdit>, YamlParseError | UnsupportedFrontmatterError>;
507
579
  /**
508
- * Edits that stamp `renders[i].body_sha256` with `digests[i]`: an existing value is replaced in
509
- * place, a missing key is inserted on the line after `renders[i].path` at that key's column.
510
- * Block-style `renders` only; flow style fails with `UnsupportedFrontmatterError`.
580
+ * Edits that stamp `renders[i].body` with `digests[i]` (16 hex, quoted when numeric-looking): an
581
+ * existing value is replaced in place, a missing key is inserted on the line after
582
+ * `renders[i].path` at that key's column. An `undefined` digest skips its entry. A legacy `renders[i].body_sha256` line in the same
583
+ * entry is removed, so an entry never ends up with both keys. Block-style `renders` only; flow
584
+ * style fails with `UnsupportedFrontmatterError`.
511
585
  */
512
- static readonly rendersDigests: (source: string, digests: ReadonlyArray<string>) => Effect.Effect<ReadonlyArray<MarkdownEdit>, YamlParseError | UnsupportedFrontmatterError>;
586
+ static readonly rendersDigests: (source: string, digests: ReadonlyArray<string | undefined>) => Effect.Effect<ReadonlyArray<MarkdownEdit>, YamlParseError | UnsupportedFrontmatterError>;
513
587
  }
514
588
  //#endregion
515
589
  //#region src/external/ExternalReferences.d.ts
@@ -633,6 +707,127 @@ export declare const targetPaths: (options: ScaffoldOptions) => ReadonlyArray<st
633
707
  */
634
708
  export declare const files: (options: ScaffoldOptions) => Effect.Effect<ReadonlyArray<ScaffoldFile>, MarkdownParseError | FrontmatterWriteError>;
635
709
  //#endregion
710
+ //#region src/move/references.d.ts
711
+ /**
712
+ * One reference's value text inside a file: whole-file offsets, quotes excluded. `field` is set for
713
+ * the frontmatter fields core resolves with path-field rules (`resource`, `sources.resource`, ...).
714
+ *
715
+ * @public
716
+ */
717
+ interface Reference {
718
+ readonly file: string;
719
+ readonly offset: number;
720
+ readonly length: number;
721
+ readonly raw: string;
722
+ readonly quote: "" | "'" | '"';
723
+ readonly field?: PathField;
724
+ /** Set for a body link whose destination sits inside angle brackets (`](<...>)`), where whitespace is legal. */
725
+ readonly angle?: true;
726
+ }
727
+ /**
728
+ * A reference {@link referencesOf} could not locate in its file: the `file: value` line and the
729
+ * decoded value, so a caller can tell whether it would have needed rewriting.
730
+ *
731
+ * @public
732
+ */
733
+ interface UnlocatableReference {
734
+ readonly entry: string;
735
+ readonly raw: string;
736
+ readonly field?: PathField;
737
+ }
738
+ /**
739
+ * Every rewritable reference in a concept, plus the references that could not be located in their file
740
+ * (`unlocatable` as `file: value` lines, `unlocatableRefs` with the decoded value). Body links, images and definitions with a URL; the path-valued frontmatter fields;
741
+ * every field the concept's type declares with `kind = "path"`; and `renders[].path`.
742
+ *
743
+ * @public
744
+ */
745
+ export declare const referencesOf: (concept: LoadedConcept, config: OkfitConfig) => {
746
+ readonly references: ReadonlyArray<Reference>;
747
+ readonly unlocatable: ReadonlyArray<string>;
748
+ readonly unlocatableRefs: ReadonlyArray<UnlocatableReference>;
749
+ };
750
+ /**
751
+ * The new text for one reference after `movedFrom` (a bundle-relative `.md` path) moves to `movedTo`,
752
+ * or `undefined` when the text stays as written. The reference was written in `fromOld`, which is
753
+ * now at `fromNew` (equal unless the file itself is the one that moved). The spelling is kept: a
754
+ * rooted reference stays rooted, a bare one stays bare, `./`, a dropped `.md`, a `#fragment`/`?query`
755
+ * suffix and a trailing `/` survive. The result may hold whitespace even when `angle` is unset (a
756
+ * percent-encoded space decodes); the caller must then refuse rather than write it outside angle brackets.
757
+ *
758
+ * @public
759
+ */
760
+ export declare const rewriteReference: (raw: string, options: {
761
+ readonly bundle: LoadedBundle;
762
+ readonly fromOld: string;
763
+ readonly fromNew: string;
764
+ readonly movedFrom: string;
765
+ readonly movedTo: string;
766
+ readonly field?: PathField;
767
+ /** The reference is a body link inside angle brackets, so its path may hold whitespace. */
768
+ readonly angle?: boolean;
769
+ }) => string | undefined;
770
+ //#endregion
771
+ //#region src/move/run.d.ts
772
+ /**
773
+ * What `okfit mv` will do. `from` and `to` are bundle-relative `.md` paths, `fromPath` and `toPath`
774
+ * their absolute forms. `edits` holds the post-move path, the edit count and the full new text of
775
+ * every file that changes, the moved file always among them (`count` may be 0). `drifts` lists the
776
+ * ids (the moved file by its old id) whose human verification is `current` now and whose text changes.
777
+ *
778
+ * @public
779
+ */
780
+ interface MovePlan {
781
+ readonly from: string;
782
+ readonly to: string;
783
+ readonly fromPath: string;
784
+ readonly toPath: string;
785
+ readonly edits: ReadonlyArray<{
786
+ readonly path: string;
787
+ readonly count: number;
788
+ readonly text: string;
789
+ }>;
790
+ readonly drifts: ReadonlyArray<string>;
791
+ }
792
+ /** @public */
793
+ interface PlanMoveOptions {
794
+ /** The concept to move: a path or id, resolved like any other concept target. */
795
+ readonly from: string;
796
+ /** The destination: an absolute path, a cwd-relative path or a bundle-relative id; `.md` is appended when missing. */
797
+ readonly to: string;
798
+ readonly cwd: string;
799
+ readonly bundleRoot: string;
800
+ readonly config: OkfitConfig;
801
+ readonly now: DateTime.Utc;
802
+ }
803
+ /** @public */
804
+ interface RunMoveOptions extends PlanMoveOptions {
805
+ readonly dryRun: boolean;
806
+ }
807
+ /** Every failure {@link planMove} and {@link runMove} can raise. @public */
808
+ type PlanError = MoveError | TargetResolutionError | BundleLoadError | PlatformError.PlatformError;
809
+ /**
810
+ * Plan moving one concept: resolve both ends, find every reference to it across the bundle (and the
811
+ * moved file's own outbound references), and compute the new text of each file that changes. Pure of
812
+ * writes; refuses with {@link MoveError} when the destination is unusable or any body link cannot be
813
+ * located for rewriting.
814
+ *
815
+ * @public
816
+ */
817
+ export declare const planMove: (options: PlanMoveOptions) => Effect.Effect<MovePlan, PlanError, Crypto.Crypto | FileSystem.FileSystem | Path.Path>;
818
+ /**
819
+ * Plan the move, then (unless `dryRun`) write it: every referrer atomically, the moved file's new
820
+ * text over its old path, then a rename to the destination (its directory created first). Nothing is
821
+ * written until the whole plan succeeded; the writes themselves are not transactional (the rename is last).
822
+ *
823
+ * @public
824
+ */
825
+ export declare const runMove: (options: RunMoveOptions) => Effect.Effect<{
826
+ readonly plan: MovePlan;
827
+ readonly bundleRoot: string;
828
+ readonly dryRun: boolean;
829
+ }, PlanError, Crypto.Crypto | FileSystem.FileSystem | Path.Path>;
830
+ //#endregion
636
831
  //#region src/overlay/documents.d.ts
637
832
  /**
638
833
  * One unsaved document: `path` is bundle-relative posix (`metrics/churn.md`),
@@ -754,8 +949,12 @@ interface ConceptFilter {
754
949
  readonly tags?: ReadonlyArray<string>;
755
950
  /** OR, compared against `Derive.status` (an absent status reads as stable). */
756
951
  readonly statuses?: ReadonlyArray<Status>;
757
- /** `true`: at least one verified entry; `false`: none. */
758
- readonly verified?: boolean;
952
+ /** `"current"`: integrity current; `"unverified"`: tier unverified. */
953
+ readonly verified?: "current" | "unverified";
954
+ /** `true`: integrity drifted. */
955
+ readonly drifted?: boolean;
956
+ /** `true`: `stale_after` has passed. */
957
+ readonly stale?: boolean;
759
958
  }
760
959
  /** One outgoing link of a concept. @public */
761
960
  interface ConceptLink {
@@ -777,8 +976,12 @@ interface ConceptNeighbor {
777
976
  * @public
778
977
  */
779
978
  export declare const ConceptQuery: {
780
- /** Validates types then tags against config (first unknown fails), then filters and sorts by id. */
781
- readonly list: (bundle: LoadedBundle, config: OkfitConfig, filter: ConceptFilter) => Effect.Effect<ReadonlyArray<LoadedConcept>, QueryUnknownVocabularyError>;
979
+ /**
980
+ * Validates types then tags against config (first unknown fails), then filters
981
+ * and sorts by id. `signals` is `Trust.signals(bundle, config, now)`; a concept with
982
+ * no signal is a caller defect.
983
+ */
984
+ readonly list: (bundle: LoadedBundle, config: OkfitConfig, filter: ConceptFilter, signals: ReadonlyMap<string, ConceptSignal>) => Effect.Effect<ReadonlyArray<LoadedConcept>, QueryUnknownVocabularyError>;
782
985
  /** One concept by tolerant id, with its outgoing links. */
783
986
  readonly get: (bundle: LoadedBundle, id: string) => Effect.Effect<{
784
987
  readonly concept: LoadedConcept;
@@ -852,6 +1055,23 @@ export declare const ContextTag: Schema.Struct<{
852
1055
  }>;
853
1056
  /** @public */
854
1057
  export type ContextTag = typeof ContextTag.Type;
1058
+ /**
1059
+ * The `--trust` summary: how many concepts have drifted, are stale, or are
1060
+ * unverified, with the first five drifted and stale ids (sorted). Counts
1061
+ * overlap (a concept can be both drifted and stale).
1062
+ *
1063
+ * @public
1064
+ */
1065
+ export declare const ContextTrust: Schema.Struct<{
1066
+ readonly concepts: Schema.Int;
1067
+ readonly drifted: Schema.Int;
1068
+ readonly stale: Schema.Int;
1069
+ readonly unverified: Schema.Int;
1070
+ readonly drifted_ids: Schema.$Array<Schema.String>;
1071
+ readonly stale_ids: Schema.$Array<Schema.String>;
1072
+ }>;
1073
+ /** @public */
1074
+ export type ContextTrust = typeof ContextTrust.Type;
855
1075
  /**
856
1076
  * M-15's envelope: schema 1, snake_case, orientation data only. Distinct
857
1077
  * from `JsonEnvelope` (`render/json.ts`) — `context` never runs conformance
@@ -914,6 +1134,14 @@ export declare const ContextEnvelope: Schema.Struct<{
914
1134
  readonly name: Schema.String;
915
1135
  readonly description: Schema.NullOr<Schema.String>;
916
1136
  }>>;
1137
+ readonly trust: Schema.NullOr<Schema.Struct<{
1138
+ readonly concepts: Schema.Int;
1139
+ readonly drifted: Schema.Int;
1140
+ readonly stale: Schema.Int;
1141
+ readonly unverified: Schema.Int;
1142
+ readonly drifted_ids: Schema.$Array<Schema.String>;
1143
+ readonly stale_ids: Schema.$Array<Schema.String>;
1144
+ }>>;
917
1145
  }>;
918
1146
  /** @public */
919
1147
  export type ContextEnvelope = typeof ContextEnvelope.Type;
@@ -934,6 +1162,8 @@ export declare const contextEnvelope: (input: {
934
1162
  readonly indexPath: string;
935
1163
  readonly indexExists: boolean;
936
1164
  readonly config: OkfitConfig;
1165
+ /** Present only under `--trust`; absent becomes `null` on the wire. */
1166
+ readonly trust?: ContextTrust;
937
1167
  }) => ContextEnvelope;
938
1168
  //#endregion
939
1169
  //#region src/render/distribution.d.ts
@@ -1228,8 +1458,70 @@ export declare const json: (input: {
1228
1458
  /** K-22. `tag` is the error's `_tag` when it has one, else its constructor name. @public */
1229
1459
  export declare const jsonError: (error: unknown, okfitVersion: string, distribution?: Distribution) => JsonErrorEnvelope;
1230
1460
  //#endregion
1461
+ //#region src/render/move.d.ts
1462
+ /**
1463
+ * `okfit mv`'s success envelope, schema 1, snake_case. `from`/`to` are bundle-relative paths, `path`
1464
+ * the display form of the destination; `edits` lists every file that changes (post-move path) with
1465
+ * its edit count, and `drifts` the ids whose current human verification the move invalidates.
1466
+ *
1467
+ * @public
1468
+ */
1469
+ export declare const MoveEnvelope: Schema.Struct<{
1470
+ readonly schema: Schema.Literal<1>;
1471
+ readonly okfit_version: Schema.String;
1472
+ readonly engine_version: Schema.String;
1473
+ readonly distribution: Schema.NullOr<Schema.Struct<{
1474
+ readonly name: Schema.String;
1475
+ readonly version: Schema.String;
1476
+ }>>;
1477
+ readonly from: Schema.String;
1478
+ readonly to: Schema.String;
1479
+ readonly path: Schema.String;
1480
+ readonly dry_run: Schema.Boolean;
1481
+ readonly edits: Schema.$Array<Schema.Struct<{
1482
+ readonly path: Schema.String;
1483
+ readonly count: Schema.Number;
1484
+ }>>;
1485
+ readonly drifts: Schema.$Array<Schema.String>;
1486
+ readonly exit_code: Schema.Literal<0>;
1487
+ }>;
1488
+ /** @public */
1489
+ export type MoveEnvelope = typeof MoveEnvelope.Type;
1490
+ /**
1491
+ * `path` is already the display form, as for the other envelope builders.
1492
+ *
1493
+ * @public
1494
+ */
1495
+ export declare const moveEnvelope: (input: {
1496
+ readonly okfitVersion: string;
1497
+ readonly from: string;
1498
+ readonly to: string;
1499
+ readonly path: string;
1500
+ readonly dryRun: boolean;
1501
+ readonly edits: ReadonlyArray<{
1502
+ readonly path: string;
1503
+ readonly count: number;
1504
+ }>;
1505
+ readonly drifts: ReadonlyArray<string>;
1506
+ readonly distribution?: Distribution;
1507
+ }) => MoveEnvelope;
1508
+ //#endregion
1231
1509
  //#region src/render/query.d.ts
1232
- /** The seven-field shape every list-like query result carries (N-16). @public */
1510
+ /**
1511
+ * Why a human verification no longer binds, as the wire reports it. `edited_by`
1512
+ * and `edited_at` are the latest human entry's actor and instant, `null` when
1513
+ * the drift has no such entry to name.
1514
+ *
1515
+ * @public
1516
+ */
1517
+ export declare const TrustDrift: Schema.Struct<{
1518
+ readonly reason: Schema.Literals<readonly ["content-changed", "unbound", "entry-superseded", "actor-not-allowed"]>;
1519
+ readonly edited_by: Schema.NullOr<Schema.String>;
1520
+ readonly edited_at: Schema.NullOr<Schema.String>;
1521
+ }>;
1522
+ /** @public */
1523
+ export type TrustDrift = typeof TrustDrift.Type;
1524
+ /** The ten-field shape every list-like query result carries: identity plus the trust signal (N-16). @public */
1233
1525
  export declare const ConceptSummary: Schema.Struct<{
1234
1526
  readonly id: Schema.String;
1235
1527
  readonly type: Schema.String;
@@ -1238,11 +1530,24 @@ export declare const ConceptSummary: Schema.Struct<{
1238
1530
  readonly status: Schema.Literals<readonly ["draft", "stable", "deprecated"]>;
1239
1531
  readonly tags: Schema.$Array<Schema.String>;
1240
1532
  readonly path: Schema.String;
1533
+ readonly tier: Schema.Literals<readonly ["unverified", "machine-confirmed", "human-reviewed"]>;
1534
+ readonly integrity: Schema.Literals<readonly ["current", "drifted", "none"]>;
1535
+ readonly stale: Schema.Boolean;
1241
1536
  }>;
1242
1537
  /** @public */
1243
1538
  export type ConceptSummary = typeof ConceptSummary.Type;
1244
- /** Project one loaded concept into its summary. @public */
1245
- export declare const toConceptSummary: (concept: LoadedConcept) => ConceptSummary;
1539
+ /** Project one loaded concept and its trust signal into its summary. @public */
1540
+ export declare const toConceptSummary: (concept: LoadedConcept, signal: ConceptSignal) => ConceptSummary;
1541
+ /**
1542
+ * The signal `Trust.signals` computed for a concept id. Every loaded concept has
1543
+ * one, so a missing entry is a defect (the map and the bundle disagree), and this
1544
+ * dies with a message naming the id rather than casting `undefined` through.
1545
+ *
1546
+ * @public
1547
+ */
1548
+ export declare const signalFor: (signals: ReadonlyMap<string, ConceptSignal>, id: string) => ConceptSignal;
1549
+ /** The wire drift of a signal, or `null` when its integrity is not drifted. @public */
1550
+ export declare const toTrustDrift: (signal: ConceptSignal) => TrustDrift | null;
1246
1551
  /** `okfit query list --format json`'s envelope, schema 1, snake_case. @public */
1247
1552
  export declare const QueryListEnvelope: Schema.Struct<{
1248
1553
  readonly schema: Schema.Literal<1>;
@@ -1261,6 +1566,9 @@ export declare const QueryListEnvelope: Schema.Struct<{
1261
1566
  readonly status: Schema.Literals<readonly ["draft", "stable", "deprecated"]>;
1262
1567
  readonly tags: Schema.$Array<Schema.String>;
1263
1568
  readonly path: Schema.String;
1569
+ readonly tier: Schema.Literals<readonly ["unverified", "machine-confirmed", "human-reviewed"]>;
1570
+ readonly integrity: Schema.Literals<readonly ["current", "drifted", "none"]>;
1571
+ readonly stale: Schema.Boolean;
1264
1572
  }>>;
1265
1573
  }>;
1266
1574
  /** @public */
@@ -1291,6 +1599,14 @@ export declare const QueryGetEnvelope: Schema.Struct<{
1291
1599
  readonly status: Schema.Literals<readonly ["draft", "stable", "deprecated"]>;
1292
1600
  readonly tags: Schema.$Array<Schema.String>;
1293
1601
  readonly path: Schema.String;
1602
+ readonly tier: Schema.Literals<readonly ["unverified", "machine-confirmed", "human-reviewed"]>;
1603
+ readonly integrity: Schema.Literals<readonly ["current", "drifted", "none"]>;
1604
+ readonly stale: Schema.Boolean;
1605
+ readonly drift: Schema.NullOr<Schema.Struct<{
1606
+ readonly reason: Schema.Literals<readonly ["content-changed", "unbound", "entry-superseded", "actor-not-allowed"]>;
1607
+ readonly edited_by: Schema.NullOr<Schema.String>;
1608
+ readonly edited_at: Schema.NullOr<Schema.String>;
1609
+ }>>;
1294
1610
  readonly frontmatter: Schema.$Record<Schema.String, Schema.Unknown>;
1295
1611
  readonly links: Schema.$Array<Schema.Struct<{
1296
1612
  readonly to: Schema.String;
@@ -1314,6 +1630,9 @@ export declare const QueryNeighbor: Schema.Struct<{
1314
1630
  readonly status: Schema.Literals<readonly ["draft", "stable", "deprecated"]>;
1315
1631
  readonly tags: Schema.$Array<Schema.String>;
1316
1632
  readonly path: Schema.String;
1633
+ readonly tier: Schema.Literals<readonly ["unverified", "machine-confirmed", "human-reviewed"]>;
1634
+ readonly integrity: Schema.Literals<readonly ["current", "drifted", "none"]>;
1635
+ readonly stale: Schema.Boolean;
1317
1636
  }>>;
1318
1637
  }>;
1319
1638
  /** @public */
@@ -1339,6 +1658,9 @@ export declare const QueryNeighborsEnvelope: Schema.Struct<{
1339
1658
  readonly status: Schema.Literals<readonly ["draft", "stable", "deprecated"]>;
1340
1659
  readonly tags: Schema.$Array<Schema.String>;
1341
1660
  readonly path: Schema.String;
1661
+ readonly tier: Schema.Literals<readonly ["unverified", "machine-confirmed", "human-reviewed"]>;
1662
+ readonly integrity: Schema.Literals<readonly ["current", "drifted", "none"]>;
1663
+ readonly stale: Schema.Boolean;
1342
1664
  }>>;
1343
1665
  }>>;
1344
1666
  readonly incoming: Schema.$Array<Schema.Struct<{
@@ -1352,6 +1674,9 @@ export declare const QueryNeighborsEnvelope: Schema.Struct<{
1352
1674
  readonly status: Schema.Literals<readonly ["draft", "stable", "deprecated"]>;
1353
1675
  readonly tags: Schema.$Array<Schema.String>;
1354
1676
  readonly path: Schema.String;
1677
+ readonly tier: Schema.Literals<readonly ["unverified", "machine-confirmed", "human-reviewed"]>;
1678
+ readonly integrity: Schema.Literals<readonly ["current", "drifted", "none"]>;
1679
+ readonly stale: Schema.Boolean;
1355
1680
  }>>;
1356
1681
  }>>;
1357
1682
  }>;
@@ -1368,6 +1693,7 @@ export declare const queryListEnvelope: (input: {
1368
1693
  export declare const queryGetEnvelope: (input: {
1369
1694
  readonly okfitVersion: string;
1370
1695
  readonly concept: ConceptSummary;
1696
+ readonly drift: TrustDrift | null;
1371
1697
  readonly frontmatter: Readonly<Record<string, unknown>>;
1372
1698
  readonly links: ReadonlyArray<QueryLink>;
1373
1699
  readonly distribution?: Distribution;
@@ -1476,7 +1802,7 @@ type SyncMode = "generated" | "index" | "log";
1476
1802
  *
1477
1803
  * @public
1478
1804
  */
1479
- export declare const SkipReason: Schema.Literals<readonly ["untracked", "dirty", "unborn", "generated-missing", "generated-unsupported", "log-unparseable"]>;
1805
+ export declare const SkipReason: Schema.Literals<readonly ["untracked", "dirty", "unborn", "generated-missing", "generated-unsupported", "integrity-unsupported", "renders-unsupported", "log-unparseable"]>;
1480
1806
  /** @public */
1481
1807
  export type SkipReason = typeof SkipReason.Type;
1482
1808
  /** @public */
@@ -1501,6 +1827,8 @@ interface SyncModeResult {
1501
1827
  /** Bundle-relative. `generated`'s ids have no `.md`; `index`/`log`'s paths do (design §2). */
1502
1828
  readonly written: ReadonlyArray<string>;
1503
1829
  readonly unchanged: ReadonlyArray<string>;
1830
+ /** `generated` mode only: ids whose legacy body digest moved to `integrity.generated.body`; may also be in `written`. */
1831
+ readonly migrated: ReadonlyArray<string>;
1504
1832
  readonly skipped: ReadonlyArray<{
1505
1833
  readonly id: string;
1506
1834
  readonly reason: SkipReason;
@@ -1575,9 +1903,10 @@ export declare const SyncModeEnvelope: Schema.Struct<{
1575
1903
  readonly selected: Schema.Boolean;
1576
1904
  readonly written: Schema.$Array<Schema.String>;
1577
1905
  readonly unchanged: Schema.$Array<Schema.String>;
1906
+ readonly migrated: Schema.$Array<Schema.String>;
1578
1907
  readonly skipped: Schema.$Array<Schema.Struct<{
1579
1908
  readonly id: Schema.String;
1580
- readonly reason: Schema.Literals<readonly ["untracked", "dirty", "unborn", "generated-missing", "generated-unsupported", "log-unparseable"]>;
1909
+ readonly reason: Schema.Literals<readonly ["untracked", "dirty", "unborn", "generated-missing", "generated-unsupported", "integrity-unsupported", "renders-unsupported", "log-unparseable"]>;
1581
1910
  }>>;
1582
1911
  }>;
1583
1912
  /** @public */
@@ -1593,7 +1922,7 @@ export declare const PublicationEnvelope: Schema.Struct<{
1593
1922
  readonly written: Schema.Boolean;
1594
1923
  readonly digests: Schema.$Array<Schema.Struct<{
1595
1924
  readonly path: Schema.String;
1596
- readonly body_sha256: Schema.String;
1925
+ readonly body: Schema.String;
1597
1926
  }>>;
1598
1927
  }>;
1599
1928
  /** @public */
@@ -1624,27 +1953,30 @@ export declare const SyncEnvelope: Schema.Struct<{
1624
1953
  readonly selected: Schema.Boolean;
1625
1954
  readonly written: Schema.$Array<Schema.String>;
1626
1955
  readonly unchanged: Schema.$Array<Schema.String>;
1956
+ readonly migrated: Schema.$Array<Schema.String>;
1627
1957
  readonly skipped: Schema.$Array<Schema.Struct<{
1628
1958
  readonly id: Schema.String;
1629
- readonly reason: Schema.Literals<readonly ["untracked", "dirty", "unborn", "generated-missing", "generated-unsupported", "log-unparseable"]>;
1959
+ readonly reason: Schema.Literals<readonly ["untracked", "dirty", "unborn", "generated-missing", "generated-unsupported", "integrity-unsupported", "renders-unsupported", "log-unparseable"]>;
1630
1960
  }>>;
1631
1961
  }>;
1632
1962
  readonly index: Schema.Struct<{
1633
1963
  readonly selected: Schema.Boolean;
1634
1964
  readonly written: Schema.$Array<Schema.String>;
1635
1965
  readonly unchanged: Schema.$Array<Schema.String>;
1966
+ readonly migrated: Schema.$Array<Schema.String>;
1636
1967
  readonly skipped: Schema.$Array<Schema.Struct<{
1637
1968
  readonly id: Schema.String;
1638
- readonly reason: Schema.Literals<readonly ["untracked", "dirty", "unborn", "generated-missing", "generated-unsupported", "log-unparseable"]>;
1969
+ readonly reason: Schema.Literals<readonly ["untracked", "dirty", "unborn", "generated-missing", "generated-unsupported", "integrity-unsupported", "renders-unsupported", "log-unparseable"]>;
1639
1970
  }>>;
1640
1971
  }>;
1641
1972
  readonly log: Schema.Struct<{
1642
1973
  readonly selected: Schema.Boolean;
1643
1974
  readonly written: Schema.$Array<Schema.String>;
1644
1975
  readonly unchanged: Schema.$Array<Schema.String>;
1976
+ readonly migrated: Schema.$Array<Schema.String>;
1645
1977
  readonly skipped: Schema.$Array<Schema.Struct<{
1646
1978
  readonly id: Schema.String;
1647
- readonly reason: Schema.Literals<readonly ["untracked", "dirty", "unborn", "generated-missing", "generated-unsupported", "log-unparseable"]>;
1979
+ readonly reason: Schema.Literals<readonly ["untracked", "dirty", "unborn", "generated-missing", "generated-unsupported", "integrity-unsupported", "renders-unsupported", "log-unparseable"]>;
1648
1980
  }>>;
1649
1981
  }>;
1650
1982
  /** Present only for `okfit sync --publication`; then the three modes are all `selected: false`. */
@@ -1653,7 +1985,7 @@ export declare const SyncEnvelope: Schema.Struct<{
1653
1985
  readonly written: Schema.Boolean;
1654
1986
  readonly digests: Schema.$Array<Schema.Struct<{
1655
1987
  readonly path: Schema.String;
1656
- readonly body_sha256: Schema.String;
1988
+ readonly body: Schema.String;
1657
1989
  }>>;
1658
1990
  }>>;
1659
1991
  }>;
@@ -1678,8 +2010,8 @@ export declare const syncEnvelope: (input: {
1678
2010
  //#region src/verify/select.d.ts
1679
2011
  /**
1680
2012
  * Why a candidate concept was skipped by batch selection: `"draft"` and
1681
- * `"deprecated"` mirror `status`, `"already-verified"` means the actor already
1682
- * carries a `verified` entry.
2013
+ * `"deprecated"` mirror `status`, `"already-verified"` means the actor's
2014
+ * `verified` entry is still bound to the concept's current content.
1683
2015
  *
1684
2016
  * @public
1685
2017
  */
@@ -1700,11 +2032,12 @@ interface AttestableSelection {
1700
2032
  /**
1701
2033
  * Issue #138/#143: which concepts of `types` the actor may attest in one
1702
2034
  * batch. A draft is unsettled and a deprecated concept is retired (#143), so
1703
- * both are skipped before the already-verified check.
2035
+ * both are skipped before the already-verified check. A concept whose
2036
+ * verification has drifted, or is bound to another actor, is a candidate.
1704
2037
  *
1705
2038
  * @public
1706
2039
  */
1707
- export declare const selectAttestable: (bundle: LoadedBundle, types: ReadonlySet<string>, actor: string) => AttestableSelection;
2040
+ export declare const selectAttestable: (bundle: LoadedBundle, types: ReadonlySet<string>, actor: string, signals: ReadonlyMap<string, ConceptSignal>) => AttestableSelection;
1708
2041
  /**
1709
2042
  * One row of the interactive verify picker: a `require_verified` concept the
1710
2043
  * actor has not attested yet.
@@ -1720,15 +2053,26 @@ interface PickerCandidate {
1720
2053
  readonly description: string | null;
1721
2054
  /** How many `verified` entries by actors other than the current one. */
1722
2055
  readonly otherAttestations: number;
2056
+ /** Whether the concept's human verification still binds its content (`none` when nobody human verified it). */
2057
+ readonly integrity: IntegrityState;
2058
+ /** Whether the concept is past its `stale_after` (or otherwise stale) at the time the rows were selected. */
2059
+ readonly stale: boolean;
2060
+ /** The concept file's bundle-relative path (`concept.path`); the loaders in `run.ts` make it absolute. */
2061
+ readonly path: string;
2062
+ /**
2063
+ * When `integrity.verified` was bound (ISO 8601), the time a drifted row's
2064
+ * preview diff is measured from; `null` when nothing is bound.
2065
+ */
2066
+ readonly boundAt: string | null;
1723
2067
  }
1724
2068
  /**
1725
2069
  * 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.
2070
+ * attested: drafts included, deprecated concepts and the actor's own still-bound
2071
+ * attestations excluded (a drifted one is offered again). Sorted by type, then id; grouping is the caller's.
1728
2072
  *
1729
2073
  * @public
1730
2074
  */
1731
- export declare const selectPickerCandidates: (bundle: LoadedBundle, config: OkfitConfig, actor: string) => ReadonlyArray<PickerCandidate>;
2075
+ export declare const selectPickerCandidates: (bundle: LoadedBundle, config: OkfitConfig, actor: string, signals: ReadonlyMap<string, ConceptSignal>) => ReadonlyArray<PickerCandidate>;
1732
2076
  /**
1733
2077
  * Issue #228: the picker rows for `okfit stale --verify`: one per stale item,
1734
2078
  * any type, deprecated concepts excluded. Unlike {@link selectPickerCandidates}
@@ -1738,7 +2082,7 @@ export declare const selectPickerCandidates: (bundle: LoadedBundle, config: Okfi
1738
2082
  *
1739
2083
  * @public
1740
2084
  */
1741
- export declare const selectStaleCandidates: (bundle: LoadedBundle, items: ReadonlyArray<StaleConcept>, actor: string) => ReadonlyArray<PickerCandidate>;
2085
+ export declare const selectStaleCandidates: (bundle: LoadedBundle, items: ReadonlyArray<StaleConcept>, actor: string, signals: ReadonlyMap<string, ConceptSignal>) => ReadonlyArray<PickerCandidate>;
1742
2086
  /**
1743
2087
  * The batch type-resolution rule shared by `runVerifyBatch` and any future
1744
2088
  * interactive picker: explicit `types` must each be declared in
@@ -1779,6 +2123,8 @@ export declare const VerifyEnvelope: Schema.Struct<{
1779
2123
  readonly from: Schema.NullOr<Schema.Literals<readonly ["draft", "stable", "deprecated"]>>;
1780
2124
  readonly to: Schema.Literals<readonly ["stable", "draft"]>;
1781
2125
  }>>;
2126
+ /** Why the prior human verification no longer bound the concept; absent when it did not drift. */
2127
+ readonly prior_integrity: Schema.optionalKey<Schema.Literals<readonly ["content-changed", "unbound", "entry-superseded", "actor-not-allowed"]>>;
1782
2128
  readonly dry_run: Schema.Boolean;
1783
2129
  readonly exit_code: Schema.Literal<0>;
1784
2130
  }>;
@@ -1803,6 +2149,8 @@ export declare const verifyEnvelope: (input: {
1803
2149
  readonly from: Status | null;
1804
2150
  readonly to: "stable" | "draft";
1805
2151
  } | null;
2152
+ /** The drift reason the prior verification had, when it had drifted. */
2153
+ readonly priorIntegrity?: DriftReason | null;
1806
2154
  readonly distribution?: Distribution;
1807
2155
  }) => VerifyEnvelope;
1808
2156
  /**
@@ -1857,6 +2205,46 @@ export declare const verifyBatchEnvelope: (input: {
1857
2205
  readonly dryRun: boolean;
1858
2206
  readonly distribution?: Distribution;
1859
2207
  }) => VerifyBatchEnvelope;
2208
+ /**
2209
+ * `okfit verify --revoke`'s success envelope, schema 1, snake_case. `removed`
2210
+ * lists the `at` of every verification entry taken out (in list order);
2211
+ * `binding_cleared` says whether `integrity.verified` went with them.
2212
+ *
2213
+ * @public
2214
+ */
2215
+ export declare const RevokeEnvelope: Schema.Struct<{
2216
+ readonly schema: Schema.Literal<1>;
2217
+ readonly okfit_version: Schema.String;
2218
+ readonly engine_version: Schema.String;
2219
+ readonly distribution: Schema.NullOr<Schema.Struct<{
2220
+ readonly name: Schema.String;
2221
+ readonly version: Schema.String;
2222
+ }>>;
2223
+ readonly id: Schema.String;
2224
+ readonly path: Schema.String;
2225
+ readonly revoked_by: Schema.String;
2226
+ readonly removed: Schema.$Array<Schema.String>;
2227
+ readonly binding_cleared: Schema.Boolean;
2228
+ readonly dry_run: Schema.Boolean;
2229
+ readonly exit_code: Schema.Literal<0>;
2230
+ }>;
2231
+ /** @public */
2232
+ export type RevokeEnvelope = typeof RevokeEnvelope.Type;
2233
+ /**
2234
+ * `path` is already the display form, as for {@link verifyEnvelope}.
2235
+ *
2236
+ * @public
2237
+ */
2238
+ export declare const revokeEnvelope: (input: {
2239
+ readonly okfitVersion: string;
2240
+ readonly id: string;
2241
+ readonly path: string;
2242
+ readonly by: string;
2243
+ readonly removed: ReadonlyArray<string>;
2244
+ readonly bindingCleared: boolean;
2245
+ readonly dryRun: boolean;
2246
+ readonly distribution?: Distribution;
2247
+ }) => RevokeEnvelope;
1860
2248
  //#endregion
1861
2249
  //#region src/session/BundleSession.d.ts
1862
2250
  /**
@@ -1924,6 +2312,8 @@ interface BundleSessionShape {
1924
2312
  readonly revalidate: (options: RevalidateOptions) => Effect.Effect<RevalidateResult, RevalidateError>;
1925
2313
  readonly bundle: () => Effect.Effect<Option.Option<LoadedBundle>>;
1926
2314
  readonly graph: () => Effect.Effect<Option.Option<LinkGraph>>;
2315
+ /** Every concept's trust signal from the last revalidate, keyed by concept id. */
2316
+ readonly signals: () => Effect.Effect<Option.Option<ReadonlyMap<string, ConceptSignal>>>;
1927
2317
  readonly config: () => OkfitConfig;
1928
2318
  }
1929
2319
  declare const BundleSession_base: Context.ServiceClass<BundleSession, "@okfit/engine/BundleSession", BundleSessionShape>;
@@ -2020,7 +2410,7 @@ export declare class NotAPublicationError extends NotAPublicationError_base {
2020
2410
  get message(): string;
2021
2411
  }
2022
2412
  /**
2023
- * Restamps one Publication's `renders[].body_sha256` digests from the current
2413
+ * Restamps one Publication's `renders[].body` digests from the current
2024
2414
  * body of each rendered source concept, writing the Publication file
2025
2415
  * atomically unless `dryRun`. `written` is whether the text changed (so a
2026
2416
  * `dryRun` that would change the file reports `true` without writing).
@@ -2034,6 +2424,59 @@ export declare const stampPublication: (options: {
2034
2424
  readonly dryRun: boolean;
2035
2425
  }) => Effect.Effect<PublicationEnvelope, PublicationNotFoundError | NotAPublicationError | BundleLoadError | YamlParseError | UnsupportedFrontmatterError | PlatformError.PlatformError, FileSystem.FileSystem | Path.Path | Crypto.Crypto>;
2036
2426
  //#endregion
2427
+ //#region src/targets/resolve.d.ts
2428
+ /**
2429
+ * One resolved concept target: the argument as typed, the bundle-relative
2430
+ * posix file path, and the concept id (absent only for a non-concept file
2431
+ * accepted under `files: true`).
2432
+ *
2433
+ * @public
2434
+ */
2435
+ interface ResolvedTarget {
2436
+ readonly arg: string;
2437
+ readonly path: string;
2438
+ readonly id: ConceptId | undefined;
2439
+ }
2440
+ /**
2441
+ * Concept targets on the CLI (spec section 13): the shared resolver every
2442
+ * concept command calls before it reads or writes anything. Resolution order
2443
+ * is absolute path, cwd-relative path, then bundle-relative id; a candidate
2444
+ * outside the bundle is discarded, never matched. With `files: true` any
2445
+ * walked bundle file is accepted, so a reserved or undecodable file can still
2446
+ * be validated.
2447
+ *
2448
+ * @public
2449
+ */
2450
+ export declare class Targets {
2451
+ private constructor();
2452
+ /** Resolve every argument or fail with every bad one; duplicates collapse to the first spelling. */
2453
+ static readonly resolve: (args: ReadonlyArray<string>, bundle: LoadedBundle, cwd: string, options?: {
2454
+ readonly files?: boolean;
2455
+ }) => Effect.Effect<ReadonlyArray<ResolvedTarget>, TargetResolutionError | PlatformError.PlatformError, FileSystem.FileSystem | Path.Path>;
2456
+ /** The nearest concept id to `arg`: a unique basename match first, else the closest by edit distance. */
2457
+ static readonly suggest: (arg: string, bundle: LoadedBundle) => string | undefined;
2458
+ }
2459
+ //#endregion
2460
+ //#region src/trust/run.d.ts
2461
+ /** @public */
2462
+ interface ContextTrustOptions {
2463
+ readonly bundleRoot: string;
2464
+ /** The merged config the bundle was loaded under; its `[actors].humans` gates the drift signal. */
2465
+ readonly config: OkfitConfig;
2466
+ /** `OKFIT_NOW` or `DateTime.now`, from the caller's own `Now` service. */
2467
+ readonly now: DateTime.Utc;
2468
+ }
2469
+ /**
2470
+ * The opt-in half of `context`: load the bundle and fold `Trust.signals`
2471
+ * into counts plus the first five drifted and stale ids. Kept apart from
2472
+ * {@link runContext} so the default path never loads the bundle; only
2473
+ * `--trust` pays for it. Hashing happens inside `Trust.signals`, and only
2474
+ * for concepts a human verification binds.
2475
+ *
2476
+ * @public
2477
+ */
2478
+ export declare const runContextTrust: (options: ContextTrustOptions) => Effect.Effect<ContextTrust, BundleLoadError | PlatformError.PlatformError, FileSystem.FileSystem | Path.Path | Crypto.Crypto>;
2479
+ //#endregion
2037
2480
  //#region src/validate/run.d.ts
2038
2481
  declare const Now_base: Context.ServiceClass<Now, "@okfit/engine/Now", DateTime.Utc>;
2039
2482
  /**
@@ -2064,7 +2507,8 @@ interface RunOptions {
2064
2507
  readonly now: DateTime.Utc;
2065
2508
  /**
2066
2509
  * S-31: skip `Provenance.lint`'s git TIER (tier 2, the git-derived date
2067
- * comparison for concepts with no recorded `generated.body_sha256`)
2510
+ * comparison for concepts with no recorded body digest: neither
2511
+ * `integrity.generated.body` nor a legacy `generated.body_sha256`)
2068
2512
  * for this one invocation, without touching the project's `[lint]`
2069
2513
  * table. `commands/validate.ts` threads `--skip-provenance` here; the
2070
2514
  * PostToolUse hook passes the flag so an edit-time `validate` stays
@@ -2083,6 +2527,8 @@ interface RunResult {
2083
2527
  readonly report: ValidationReport;
2084
2528
  /** `[]` when `profile` is `None`. */
2085
2529
  readonly profileDiagnostics: ReadonlyArray<ProfileDiagnostic>;
2530
+ /** The trust signal of every concept, keyed by concept id; computed once and shared with `Trust.lint`. */
2531
+ readonly signals: ReadonlyMap<string, ConceptSignal>;
2086
2532
  }
2087
2533
  /**
2088
2534
  * Load, validate both tiers, run the profile check, then — UNLESS the
@@ -2091,7 +2537,7 @@ interface RunResult {
2091
2537
  * HERE, in `run`: a bundle configured `off` never calls `Provenance.lint`
2092
2538
  * at all. `options.skipProvenance` is no longer that gate — it is threaded
2093
2539
  * through as `Provenance.lint`'s `skipGitTier` option instead, so tier 1
2094
- * (the pure, in-memory `generated.body_sha256` comparison) still runs and
2540
+ * (the pure, in-memory recorded-body-digest comparison) still runs and
2095
2541
  * still reports drift even when `skipProvenance` is `true`; only tier 2
2096
2542
  * (the git-derived date comparison, for concepts with no recorded digest)
2097
2543
  * is skipped, and with it the only git spawn `Provenance.lint` can make
@@ -2101,7 +2547,7 @@ interface RunResult {
2101
2547
  * the same `report.lint` array every other core lint diagnostic already
2102
2548
  * does.
2103
2549
  *
2104
- * It then appends `lintResources`, `Publications.lint` (`publication-drift`
2550
+ * It then appends `Trust.lint` (`verified-drift`, which gates itself on its own severity), `lintResources`, `Publications.lint` (`publication-drift`
2105
2551
  * and `publication-orphan`, only under the `software-project` profile) and `lintSurfaces` (`surface-unmatched`), each
2106
2552
  * of which gates itself on its own severity.
2107
2553
  *
@@ -2116,6 +2562,64 @@ interface RunResult {
2116
2562
  */
2117
2563
  export declare const run: (options: RunOptions) => Effect.Effect<RunResult, BundleLoadError | GitHistoryError | GitCommandError | UnknownRefError | PlatformError.PlatformError, FileSystem.FileSystem | Path.Path | Git | GitHistory | Crypto.Crypto>;
2118
2564
  //#endregion
2565
+ //#region src/verify/diff.d.ts
2566
+ /**
2567
+ * What changed in a concept file since a human last verified it.
2568
+ *
2569
+ * `diff` carries the patch from the baseline commit to the working tree (so it
2570
+ * includes uncommitted edits); `no-baseline` says why there is none: the
2571
+ * verification was never bound (`unbound`), no commit touching the file is at or
2572
+ * before the bound time (`no-commit-before`), or the file is outside a git
2573
+ * repository (`not-a-repository`).
2574
+ *
2575
+ * @public
2576
+ */
2577
+ type ChangeSince = {
2578
+ readonly _tag: "diff";
2579
+ readonly baseline: string;
2580
+ readonly patch: string;
2581
+ } | {
2582
+ readonly _tag: "no-baseline";
2583
+ readonly reason: "unbound" | "no-commit-before" | "not-a-repository";
2584
+ };
2585
+ /**
2586
+ * The patch between the version of `file` a human verified (`at`) and what is
2587
+ * on disk now.
2588
+ *
2589
+ * The baseline is the newest commit touching the file whose committer date is
2590
+ * at or before `at`; the patch is `git diff <baseline> -- <file>`.
2591
+ *
2592
+ * Git access: `@effected/git`'s `Git.log` (scoped to the file, newest first,
2593
+ * filtered here on `committedAt`) finds the baseline. `Git.log` has no `until`,
2594
+ * and no `Git` member returns a patch (`show` returns a blob, `nameStatus` only
2595
+ * paths), so the diff itself runs `git diff` through `effect/process`'s
2596
+ * `ChildProcessSpawner`, the same spawner `Git.layer` is built on. Spawn
2597
+ * failure maps onto `Git`'s own `GitCommandError`.
2598
+ *
2599
+ * @param options - `file` is the absolute path of the concept file; `at` is the
2600
+ * time the binding recorded.
2601
+ * @public
2602
+ */
2603
+ export declare const changeSince: (options: {
2604
+ readonly file: string;
2605
+ readonly at: DateTime.Utc;
2606
+ }) => Effect.Effect<{
2607
+ _tag: "no-baseline";
2608
+ reason: "not-a-repository";
2609
+ baseline?: never;
2610
+ patch?: never;
2611
+ } | {
2612
+ _tag: "no-baseline";
2613
+ reason: "no-commit-before";
2614
+ baseline?: never;
2615
+ patch?: never;
2616
+ } | {
2617
+ reason?: never;
2618
+ _tag: "diff";
2619
+ baseline: string;
2620
+ patch: string;
2621
+ }, GitCommandError, ChildProcessSpawner.ChildProcessSpawner | Git | Path.Path>;
2622
+ //#endregion
2119
2623
  //#region src/verify/run.d.ts
2120
2624
  /** @internal */
2121
2625
  interface VerifyOptions {
@@ -2155,6 +2659,10 @@ interface VerifyResult {
2155
2659
  } | null;
2156
2660
  /** The exact status bytes spliced, or `null` when no status edit was made. */
2157
2661
  readonly statusFragment: string | null;
2662
+ /** The content digest `integrity.verified` was bound to; the digest of the file before AND after the edit. */
2663
+ readonly content: string;
2664
+ /** Why the concept's prior human verification no longer bound it, or `null` when it did not drift. */
2665
+ readonly priorDrift: DriftReason | null;
2158
2666
  }
2159
2667
  /**
2160
2668
  * Issue #138: options for {@link runVerifyBatch}. `types` restricts the
@@ -2218,12 +2726,125 @@ export declare const runVerify: (options: VerifyOptions) => Effect.Effect<{
2218
2726
  to: "draft" | "stable";
2219
2727
  } | null;
2220
2728
  statusFragment: string | null;
2221
- }, import("effect/PlatformError").PlatformError | VerifyConceptNotFoundError | VerifyUnsupportedFrontmatterError | import("@effected/yaml").YamlParseError | import("@okfit/core").BundleLoadError | import("@okfit/profiles").GeneratedByError, FileSystem.FileSystem | import("@effected/git").Git | Path.Path>;
2729
+ content: string;
2730
+ priorDrift: "actor-not-allowed" | "content-changed" | "entry-superseded" | "unbound" | null;
2731
+ }, 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>;
2732
+ /**
2733
+ * What {@link inspectDrift} found out about one concept before a re-verify.
2734
+ *
2735
+ * @internal
2736
+ */
2737
+ interface DriftInspection {
2738
+ readonly id: string;
2739
+ /** Absolute path of the concept file. */
2740
+ readonly absolutePath: string;
2741
+ /** Why its human verification no longer binds, or `null` when it does not drift. */
2742
+ readonly drift: DriftReason | null;
2743
+ /** When `integrity.verified` was bound, the time the shown patch is measured from; absent when unbound. */
2744
+ readonly boundAt?: DateTime.Utc;
2745
+ }
2746
+ /**
2747
+ * Read-only: is the concept's prior human verification drifted, and if so from
2748
+ * when was it bound? The CLI asks this before `runVerify` so it can show what
2749
+ * changed. Writes nothing.
2750
+ *
2751
+ * @internal
2752
+ */
2753
+ export declare const inspectDrift: (options: {
2754
+ readonly id: string;
2755
+ readonly bundleRoot: string;
2756
+ readonly config: OkfitConfig;
2757
+ readonly now: DateTime.Utc;
2758
+ }) => Effect.Effect<{
2759
+ id: ConceptId;
2760
+ absolutePath: string;
2761
+ drift: "actor-not-allowed" | "content-changed" | "entry-superseded" | "unbound" | null;
2762
+ boundAt?: DateTime.Utc;
2763
+ }, import("effect/PlatformError").PlatformError | VerifyConceptNotFoundError | import("@okfit/core").BundleLoadError, import("effect/Crypto").Crypto | FileSystem.FileSystem | Path.Path>;
2764
+ /**
2765
+ * Options for {@link runRevoke}.
2766
+ *
2767
+ * @internal
2768
+ */
2769
+ interface RevokeOptions {
2770
+ readonly id: string;
2771
+ readonly bundleRoot: string;
2772
+ readonly projectRoot: string;
2773
+ readonly config: OkfitConfig;
2774
+ readonly dryRun: boolean;
2775
+ }
2776
+ /**
2777
+ * What {@link runRevoke} removed (or, under a dry run, would remove).
2778
+ *
2779
+ * @internal
2780
+ */
2781
+ interface RevokeResult {
2782
+ readonly id: string;
2783
+ readonly bundleRoot: string;
2784
+ readonly conceptPath: string;
2785
+ /** The resolved actor whose entries were removed. */
2786
+ readonly by: string;
2787
+ /** The encoded `at` of every removed entry, in list order. */
2788
+ readonly removed: ReadonlyArray<string>;
2789
+ /** Whether `integrity.verified` (bound to this actor) was removed too. */
2790
+ readonly bindingCleared: boolean;
2791
+ readonly dryRun: boolean;
2792
+ }
2793
+ /**
2794
+ * `okfit verify --revoke`: removes every `verified` entry by the resolved
2795
+ * human actor (the same git identity `verify` records) and, when
2796
+ * `integrity.verified` is bound to that actor, that slot too, deleting the
2797
+ * whole `integrity` block only when nothing else is left in it. Every cut is a
2798
+ * byte-precise splice; an unsupported `verified` or `integrity` shape fails
2799
+ * closed with the file untouched, and an actor with no entry fails
2800
+ * `VerifyNothingToRevokeError`. Another actor's entries and binding are never
2801
+ * touched, so they then read as `entry-superseded` or unbound by themselves.
2802
+ *
2803
+ * @internal
2804
+ */
2805
+ export declare const runRevoke: (options: RevokeOptions) => Effect.Effect<{
2806
+ id: ConceptId;
2807
+ bundleRoot: string;
2808
+ conceptPath: string;
2809
+ by: string;
2810
+ removed: string[];
2811
+ bindingCleared: boolean;
2812
+ dryRun: boolean;
2813
+ }, 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>;
2814
+ /**
2815
+ * Options for {@link runRevokeIds}.
2816
+ *
2817
+ * @internal
2818
+ */
2819
+ interface RevokeIdsOptions {
2820
+ readonly ids: ReadonlyArray<string>;
2821
+ readonly bundleRoot: string;
2822
+ readonly projectRoot: string;
2823
+ readonly config: OkfitConfig;
2824
+ readonly dryRun: boolean;
2825
+ }
2826
+ /**
2827
+ * {@link runRevoke} for several concepts, all or nothing: every revoke is
2828
+ * prepared before the first write, so one concept with nothing to revoke (or an
2829
+ * unsupported shape, or an unknown id) fails the call with the tree untouched.
2830
+ * Duplicate ids collapse to one. Results come back in the order given.
2831
+ *
2832
+ * @internal
2833
+ */
2834
+ export declare const runRevokeIds: (options: RevokeIdsOptions) => Effect.Effect<{
2835
+ id: ConceptId;
2836
+ bundleRoot: string;
2837
+ conceptPath: string;
2838
+ by: string;
2839
+ removed: string[];
2840
+ bindingCleared: boolean;
2841
+ dryRun: boolean;
2842
+ }[], 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
2843
  /**
2223
2844
  * Issue #138. Attests every concept selected by `options.types` (or, when
2224
2845
  * empty, every type whose declaration sets `require_verified = true`) that
2225
- * is not a draft, is not deprecated (#143) and does not already carry a `verified` entry by the
2226
- * resolved actor. Every candidate is located FIRST -- an unsupported
2846
+ * is not a draft, is not deprecated (#143) and whose `verified` entry by the
2847
+ * resolved actor does not already bind its current content (`Trust.signals`). Every candidate is located FIRST -- an unsupported
2227
2848
  * `verified` shape on any one of them fails the whole batch with nothing
2228
2849
  * written, mirroring `runVerify`'s own fail-closed rule at batch scale.
2229
2850
  *
@@ -2243,7 +2864,7 @@ export declare const runVerifyBatch: (options: VerifyBatchOptions) => Effect.Eff
2243
2864
  readonly id: string;
2244
2865
  readonly reason: VerifyBatchSkipReason;
2245
2866
  }[];
2246
- }, import("effect/PlatformError").PlatformError | VerifySelectionError | VerifyUnsupportedFrontmatterError | import("@effected/yaml").YamlParseError | import("@okfit/core").BundleLoadError | import("@okfit/profiles").GeneratedByError, FileSystem.FileSystem | import("@effected/git").Git | Path.Path>;
2867
+ }, 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
2868
  /**
2248
2869
  * Issue #214: options for {@link runVerifyIds}.
2249
2870
  *
@@ -2291,7 +2912,7 @@ export declare const runVerifyIds: (options: VerifyIdsOptions) => Effect.Effect<
2291
2912
  fragment: string;
2292
2913
  }[];
2293
2914
  skipped: never[];
2294
- }, import("effect/PlatformError").PlatformError | VerifyConceptNotFoundError | VerifyUnsupportedFrontmatterError | import("@effected/yaml").YamlParseError | import("@okfit/core").BundleLoadError | import("@okfit/profiles").GeneratedByError, FileSystem.FileSystem | import("@effected/git").Git | Path.Path>;
2915
+ }, 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
2916
  /**
2296
2917
  * Options for {@link loadPickerCandidates}.
2297
2918
  *
@@ -2312,7 +2933,7 @@ interface PickerCandidatesOptions {
2312
2933
  export declare const loadPickerCandidates: (options: PickerCandidatesOptions) => Effect.Effect<{
2313
2934
  by: Actor;
2314
2935
  candidates: readonly PickerCandidate[];
2315
- }, import("@okfit/core").BundleLoadError | import("@okfit/profiles").GeneratedByError, FileSystem.FileSystem | import("@effected/git").Git | Path.Path>;
2936
+ }, 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
2937
  /**
2317
2938
  * Issue #228: as {@link loadPickerCandidates}, but the rows are the concepts
2318
2939
  * stale at `now` (any type, the actor's own attestations included), for
@@ -2325,7 +2946,18 @@ export declare const loadStaleCandidates: (options: PickerCandidatesOptions & {
2325
2946
  }) => Effect.Effect<{
2326
2947
  by: Actor;
2327
2948
  candidates: readonly PickerCandidate[];
2328
- }, import("@okfit/core").BundleLoadError | import("@okfit/profiles").GeneratedByError, FileSystem.FileSystem | import("@effected/git").Git | Path.Path>;
2949
+ }, import("effect/PlatformError").PlatformError | import("@okfit/core").BundleLoadError | import("@okfit/profiles").VerifierError, import("effect/Crypto").Crypto | FileSystem.FileSystem | import("@effected/git").Git | Path.Path>;
2950
+ /**
2951
+ * The verify picker's diff previews: for each drifted candidate, in candidate
2952
+ * order and one at a time, what changed in its file since its verification was
2953
+ * bound ({@link changeSince}). A candidate with no binding is `no-baseline`
2954
+ * `unbound` without touching git, and a git failure reading the history is
2955
+ * `no-baseline` `not-a-repository`, so a preview never fails the picker. Rows
2956
+ * that are not drifted get no entry. Reads only.
2957
+ *
2958
+ * @public
2959
+ */
2960
+ 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
2961
  //#endregion
2330
2962
  //#region src/version.d.ts
2331
2963
  /**
@@ -2342,5 +2974,5 @@ export declare const loadStaleCandidates: (options: PickerCandidatesOptions & {
2342
2974
  */
2343
2975
  export declare const ENGINE_VERSION: string;
2344
2976
  //#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 };
2977
+ export type { AttestableSelection, BundleSessionOptions, BundleSessionServices, BundleSessionShape, ChangeSince, ConceptFilter, ConceptLink, ConceptNeighbor, ContextResult, ContextRunOptions, ContextTrustOptions, DiagnosticSource, DiscoveredConfig, Distribution, DocumentInput, DriftInspection, ExternalReferencesShape, GraphRunOptions, GraphRunResult, MovePlan, OverlayDocument, OverlayDocumentsShape, PendingWrite, PickerCandidate, PickerCandidatesOptions, PlanError, PlanMoveOptions, Reference, RenderedDiagnostic, ResolveProjectConfigInput, ResolvedProjectConfig, ResolvedTarget, RevalidateError, RevalidateOptions, RevalidateResult, RevalidateTier, RevokeIdsOptions, RevokeOptions, RevokeResult, RunMoveOptions, RunOptions, RunResult, ScaffoldFile, ScaffoldOptions, StaleRunOptions, StaleRunResult, SyncMode, SyncModeResult, SyncOptions, SyncPlan, SyncResult, Tally, UnlocatableReference, VerifyBatchOptions, VerifyBatchResult, VerifyBatchSkipReason, VerifyIdsOptions, VerifyOptions, VerifyResult, WatchedFilesOutcome };
2346
2978
  //# sourceMappingURL=index.d.ts.map