@okfit/core 0.14.0 → 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
@@ -3,13 +3,13 @@
3
3
  *
4
4
  * @packageDocumentation
5
5
  */
6
- import { Brand, DateTime, Duration, Effect, FileSystem, Graph as Graph$1, Option, Path, Schema } from "effect";
7
- import { MarkdownDocument } from "@effected/markdown";
6
+ import { Brand, DateTime, Duration, Effect, FileSystem, Graph as Graph$1, Option, Path, Result, Schema } from "effect";
7
+ import { MarkdownDocument, MarkdownParseError } from "@effected/markdown";
8
8
  import { ConfigReadError } from "@effected/config-file";
9
9
  import { HostedSchema } from "@effected/schemastore";
10
10
  /**
11
- * An OKF actor string: `<producer>/<version>`, `human:<id>`, `process:<id>`,
12
- * or any other `<prefix>:<id>` (the spec's `team:` examples).
11
+ * An OKF actor string: `<producer>/<version>`, `human:<id>`, `team:<id>`,
12
+ * `process:<id>`, or any other `<prefix>:<id>`.
13
13
  * @public
14
14
  */
15
15
  export type Actor = string & Brand.Brand<"Actor">;
@@ -17,7 +17,7 @@ export type Actor = string & Brand.Brand<"Actor">;
17
17
  * Prefix classification; `other` drives lint `actor-prefix-unknown` (D-18).
18
18
  * @public
19
19
  */
20
- type ActorForm = "producer" | "human" | "process" | "other";
20
+ type ActorForm = "producer" | "human" | "team" | "process" | "other";
21
21
  /**
22
22
  * Branded, pattern-checked actor codec with prefix classification statics.
23
23
  * @public
@@ -55,8 +55,8 @@ declare const ComputationParameter_base: Schema.Class<ComputationParameter, Sche
55
55
  */
56
56
  export declare class ComputationParameter extends ComputationParameter_base {}
57
57
  declare const ComputationExecutor_base: Schema.Class<ComputationExecutor, Schema.Struct<{
58
- readonly resource: Schema.String;
59
- readonly receipt: Schema.$Array<Schema.String>;
58
+ readonly resource: Schema.optionalKey<Schema.String>;
59
+ readonly receipt: Schema.optionalKey<Schema.$Array<Schema.String>>;
60
60
  }>, {}>;
61
61
  /**
62
62
  * The skill that runs the computation and the receipt fields it must return.
@@ -64,7 +64,7 @@ declare const ComputationExecutor_base: Schema.Class<ComputationExecutor, Schema
64
64
  */
65
65
  export declare class ComputationExecutor extends ComputationExecutor_base {}
66
66
  declare const ComputationAttester_base: Schema.Class<ComputationAttester, Schema.Struct<{
67
- readonly resource: Schema.String;
67
+ readonly resource: Schema.optionalKey<Schema.String>;
68
68
  }>, {}>;
69
69
  /**
70
70
  * The deterministic attester that checks an executor's receipt.
@@ -96,7 +96,7 @@ declare const Generated_base: Schema.Class<Generated, Schema.Struct<{
96
96
  /**
97
97
  * Legacy (pre-integrity) body digest, read only as a migration fallback and never
98
98
  * written. Lenient on purpose: a malformed legacy value must never fail the
99
- * `generated` family and drop `by`/`at`. `okfit sync` moves it to `integrity.generated.body`.
99
+ * `generated` family and drop `by`/`at`. `okfit sync` moves it to `x-okfit-integrity.generated.body`.
100
100
  */
101
101
  readonly body_sha256: Schema.optionalKey<Schema.String>;
102
102
  }>, {}>;
@@ -120,6 +120,17 @@ export declare const Digest: Schema.String;
120
120
  * @public
121
121
  */
122
122
  export type Digest = typeof Digest.Type;
123
+ /**
124
+ * The prefix of every frontmatter key okfit owns (OKF v0.3 section 4.1 extension keys).
125
+ * @public
126
+ */
127
+ export declare const OKFIT_KEY_PREFIX = "x-okfit-";
128
+ /**
129
+ * The top-level frontmatter key that holds okfit's {@link Integrity} family.
130
+ * Every reader and writer of that key goes through this constant.
131
+ * @public
132
+ */
133
+ export declare const INTEGRITY_KEY: "x-okfit-integrity";
123
134
  declare const IntegrityGenerated_base: Schema.Class<IntegrityGenerated, Schema.Struct<{
124
135
  readonly body: Schema.String;
125
136
  }>, {}>;
@@ -150,14 +161,14 @@ declare const Integrity_base: Schema.Class<Integrity, Schema.Struct<{
150
161
  }>, {}>;
151
162
  /**
152
163
  * okfit's own top-level frontmatter family, the only place okfit stores digests
153
- * (OKF v0.2 section 4.1 extension key). Spec families such as `generated` and
164
+ * (OKF v0.3 section 4.1 extension key). Spec families such as `generated` and
154
165
  * `verified` stay exactly as the spec defines them.
155
166
  * @public
156
167
  */
157
168
  export declare class Integrity extends Integrity_base {}
158
169
  declare const UsageWindow_base: Schema.Class<UsageWindow, Schema.Struct<{
159
- readonly from: Schema.Codec<import("effect/DateTime").Utc, string, never, never>;
160
- readonly to: Schema.Codec<import("effect/DateTime").Utc, string, never, never>;
170
+ readonly from: Schema.optionalKey<Schema.Codec<import("effect/DateTime").Utc, string, never, never>>;
171
+ readonly to: Schema.optionalKey<Schema.Codec<import("effect/DateTime").Utc, string, never, never>>;
161
172
  }>, {}>;
162
173
  /**
163
174
  * A closed interval of use, on a concept or on one of its sources.
@@ -214,6 +225,26 @@ export declare class Verification extends Verification_base {
214
225
  * @public
215
226
  */
216
227
  export declare const ATTESTED_COMPUTATION_TYPE: "Attested Computation";
228
+ declare const EntryPaths_base: Schema.Class<EntryPaths, Schema.Struct<{
229
+ readonly tags: Schema.optionalKey<Schema.$Array<Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Number]>>>>;
230
+ readonly sources: Schema.optionalKey<Schema.$Array<Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Number]>>>>;
231
+ readonly verified: Schema.optionalKey<Schema.$Array<Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Number]>>>>;
232
+ readonly parameters: Schema.optionalKey<Schema.$Array<Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Number]>>>>;
233
+ }>, {}>;
234
+ /**
235
+ * The YAML path of each kept entry of the four list families, in kept order. Tolerant
236
+ * reading drops an unreadable entry, so a kept entry's decoded index is not its YAML
237
+ * index; every range or edit path computed from a list family comes from here, through
238
+ * `Concept.entryPath`. A single item (a bare mapping) records `["sources"]`.
239
+ *
240
+ * @public
241
+ */
242
+ export declare class EntryPaths extends EntryPaths_base {}
243
+ /**
244
+ * A list family whose kept entries carry a recorded YAML path.
245
+ * @public
246
+ */
247
+ type EntryFamily = "tags" | "sources" | "verified" | "parameters";
217
248
  declare const Concept_base: Schema.Class<Concept, Schema.Struct<{
218
249
  readonly type: Schema.String;
219
250
  readonly title: Schema.optionalKey<Schema.String>;
@@ -226,8 +257,10 @@ declare const Concept_base: Schema.Class<Concept, Schema.Struct<{
226
257
  readonly verified: Schema.optionalKey<Schema.decodeTo<Schema.$Array<Schema.toType<typeof Verification>>, Schema.Union<readonly [typeof Verification, Schema.$Array<typeof Verification>]>, never, never>>;
227
258
  readonly status: Schema.optionalKey<Schema.Literals<readonly ["draft", "stable", "deprecated"]>>;
228
259
  readonly stale_after: Schema.optionalKey<Schema.Codec<import("effect/DateTime").Utc, string, never, never>>;
260
+ readonly superseded_by: Schema.optionalKey<Schema.String>;
229
261
  readonly integrity: Schema.optionalKey<typeof Integrity>;
230
262
  readonly attested: Schema.optionalKey<typeof AttestedComputation>;
263
+ readonly entries: Schema.optionalKey<typeof EntryPaths>;
231
264
  readonly extensions: Schema.$Record<Schema.String, Schema.Unknown>;
232
265
  readonly raw: Schema.$Record<Schema.String, Schema.Unknown>;
233
266
  }>, {}>;
@@ -242,7 +275,22 @@ declare const Concept_base: Schema.Class<Concept, Schema.Struct<{
242
275
  * not a subclass, so a bad `executor` cannot reject the concept.
243
276
  * @public
244
277
  */
245
- export declare class Concept extends Concept_base {}
278
+ export declare class Concept extends Concept_base {
279
+ /**
280
+ * The YAML path of the `position`-th kept entry of a list family. Without recorded
281
+ * `entries` (a hand-built concept) it falls back to `[family, position]`, or `[family]`
282
+ * when `raw[family]` is not a list.
283
+ */
284
+ static entryPath(concept: Concept, family: EntryFamily, position: number): ReadonlyArray<string | number>;
285
+ /**
286
+ * OKF 0.3 §11.2 rule 1: `undefined`, `null`, an empty string and an empty list read as absent.
287
+ *
288
+ * @remarks
289
+ * A mapping, `{}` included, is not absent. A family the decoder ignores (a `generated` without a readable
290
+ * `by`) reads as absent through the decoded `Concept`, not through this predicate.
291
+ */
292
+ static isAbsent(value: unknown): boolean;
293
+ }
246
294
  /** A posix bundle-relative path with `.md` stripped and no leading slash (D-12). @public */
247
295
  export type ConceptId = string & Brand.Brand<"ConceptId">;
248
296
  /**
@@ -261,15 +309,15 @@ export declare const DiagnosticSeverity: Schema.Literals<readonly ["error", "war
261
309
  /** @public */
262
310
  export type DiagnosticSeverity = typeof DiagnosticSeverity.Type;
263
311
  /** Always `"error"`, never configurable (D-33). @public */
264
- export declare const ConformanceCode: Schema.Literals<readonly ["frontmatter-missing", "frontmatter-unclosed", "frontmatter-unparseable", "type-missing", "index-frontmatter", "index-malformed", "log-heading-invalid", "log-malformed"]>;
312
+ export declare const ConformanceCode: Schema.Literals<readonly ["frontmatter-unclosed", "frontmatter-unparseable", "index-frontmatter", "index-malformed", "log-heading-invalid", "log-malformed"]>;
265
313
  /** @public */
266
314
  export type ConformanceCode = typeof ConformanceCode.Type;
267
315
  /** Severity from `OkfitConfig` (D-34). @public */
268
- export declare const LintCode: Schema.Literals<readonly ["broken-links", "missing-index", "unknown-type", "required-key-missing", "field-value-unknown", "require-verified-unmet", "family-invalid", "computation-runtime-missing", "footnote-source-unknown", "footnote-undefined", "log-frontmatter", "actor-prefix-unknown", "legacy-timestamp", "config-unknown-key", "stale", "walk-unreadable", "generated-at-drift", "status-missing", "source-resource-missing", "generated-missing", "publication-drift", "publication-orphan", "surface-unmatched", "verified-drift", "actor-email", "verified-actor-unknown", "resource-ignored", "resource-untracked"]>;
316
+ export declare const LintCode: Schema.Literals<readonly ["broken-links", "missing-index", "unknown-type", "required-key-missing", "field-value-unknown", "require-verified-unmet", "verified-before-change", "family-invalid", "computation-runtime-missing", "footnote-source-unknown", "footnote-undefined", "log-frontmatter", "actor-prefix-unknown", "legacy-timestamp", "config-unknown-key", "config-okf-version-stale", "stale", "walk-unreadable", "read-changed", "generated-at-drift", "status-missing", "source-resource-missing", "generated-missing", "publication-drift", "publication-orphan", "surface-unmatched", "verified-drift", "actor-email", "verified-actor-unknown", "resource-ignored", "resource-untracked", "resource-outside-project", "superseded-by-orphan", "superseded-by-unresolved", "index-metadata-invalid", "entry-ignored", "value-malformed", "value-unknown", "frontmatter-missing", "type-missing", "symlink-escape", "non-concept-unlisted", "computation-missing", "generated-at-future"]>;
269
317
  /** @public */
270
318
  export type LintCode = typeof LintCode.Type;
271
319
  /** @public */
272
- export declare const DiagnosticCode: Schema.Union<readonly [Schema.Literals<readonly ["frontmatter-missing", "frontmatter-unclosed", "frontmatter-unparseable", "type-missing", "index-frontmatter", "index-malformed", "log-heading-invalid", "log-malformed"]>, Schema.Literals<readonly ["broken-links", "missing-index", "unknown-type", "required-key-missing", "field-value-unknown", "require-verified-unmet", "family-invalid", "computation-runtime-missing", "footnote-source-unknown", "footnote-undefined", "log-frontmatter", "actor-prefix-unknown", "legacy-timestamp", "config-unknown-key", "stale", "walk-unreadable", "generated-at-drift", "status-missing", "source-resource-missing", "generated-missing", "publication-drift", "publication-orphan", "surface-unmatched", "verified-drift", "actor-email", "verified-actor-unknown", "resource-ignored", "resource-untracked"]>]>;
320
+ export declare const DiagnosticCode: Schema.Union<readonly [Schema.Literals<readonly ["frontmatter-unclosed", "frontmatter-unparseable", "index-frontmatter", "index-malformed", "log-heading-invalid", "log-malformed"]>, Schema.Literals<readonly ["broken-links", "missing-index", "unknown-type", "required-key-missing", "field-value-unknown", "require-verified-unmet", "verified-before-change", "family-invalid", "computation-runtime-missing", "footnote-source-unknown", "footnote-undefined", "log-frontmatter", "actor-prefix-unknown", "legacy-timestamp", "config-unknown-key", "config-okf-version-stale", "stale", "walk-unreadable", "read-changed", "generated-at-drift", "status-missing", "source-resource-missing", "generated-missing", "publication-drift", "publication-orphan", "surface-unmatched", "verified-drift", "actor-email", "verified-actor-unknown", "resource-ignored", "resource-untracked", "resource-outside-project", "superseded-by-orphan", "superseded-by-unresolved", "index-metadata-invalid", "entry-ignored", "value-malformed", "value-unknown", "frontmatter-missing", "type-missing", "symlink-escape", "non-concept-unlisted", "computation-missing", "generated-at-future"]>]>;
273
321
  /** @public */
274
322
  export type DiagnosticCode = typeof DiagnosticCode.Type;
275
323
  declare const DiagnosticRange_base: Schema.Class<DiagnosticRange, Schema.Struct<{
@@ -299,11 +347,20 @@ export declare class DiagnosticRange extends DiagnosticRange_base {
299
347
  * @public
300
348
  */
301
349
  static readonly forFrontmatterPath: (document: MarkdownDocument, path: ReadonlyArray<string | number>) => DiagnosticRange | undefined;
350
+ /**
351
+ * Maps a frontmatter YAML path to the range of its last segment's own key inside `document.source`, or `undefined`
352
+ * when the document has no frontmatter block, the path does not end in a written mapping key, or the key is not
353
+ * there. For a caller that edits a key whose value has no text of its own (a bare `body:` or `body: !!null`, which
354
+ * {@link DiagnosticRange.forFrontmatterPath} reports as the whole block), so it can still find where the value goes.
355
+ *
356
+ * @public
357
+ */
358
+ static readonly forFrontmatterKey: (document: MarkdownDocument, path: ReadonlyArray<string | number>) => DiagnosticRange | undefined;
302
359
  }
303
360
  declare const Diagnostic_base: Schema.Class<Diagnostic, Schema.Struct<{
304
361
  readonly file: Schema.String;
305
362
  readonly range: Schema.optionalKey<typeof DiagnosticRange>;
306
- readonly code: Schema.Union<readonly [Schema.Literals<readonly ["frontmatter-missing", "frontmatter-unclosed", "frontmatter-unparseable", "type-missing", "index-frontmatter", "index-malformed", "log-heading-invalid", "log-malformed"]>, Schema.Literals<readonly ["broken-links", "missing-index", "unknown-type", "required-key-missing", "field-value-unknown", "require-verified-unmet", "family-invalid", "computation-runtime-missing", "footnote-source-unknown", "footnote-undefined", "log-frontmatter", "actor-prefix-unknown", "legacy-timestamp", "config-unknown-key", "stale", "walk-unreadable", "generated-at-drift", "status-missing", "source-resource-missing", "generated-missing", "publication-drift", "publication-orphan", "surface-unmatched", "verified-drift", "actor-email", "verified-actor-unknown", "resource-ignored", "resource-untracked"]>]>;
363
+ readonly code: Schema.Union<readonly [Schema.Literals<readonly ["frontmatter-unclosed", "frontmatter-unparseable", "index-frontmatter", "index-malformed", "log-heading-invalid", "log-malformed"]>, Schema.Literals<readonly ["broken-links", "missing-index", "unknown-type", "required-key-missing", "field-value-unknown", "require-verified-unmet", "verified-before-change", "family-invalid", "computation-runtime-missing", "footnote-source-unknown", "footnote-undefined", "log-frontmatter", "actor-prefix-unknown", "legacy-timestamp", "config-unknown-key", "config-okf-version-stale", "stale", "walk-unreadable", "read-changed", "generated-at-drift", "status-missing", "source-resource-missing", "generated-missing", "publication-drift", "publication-orphan", "surface-unmatched", "verified-drift", "actor-email", "verified-actor-unknown", "resource-ignored", "resource-untracked", "resource-outside-project", "superseded-by-orphan", "superseded-by-unresolved", "index-metadata-invalid", "entry-ignored", "value-malformed", "value-unknown", "frontmatter-missing", "type-missing", "symlink-escape", "non-concept-unlisted", "computation-missing", "generated-at-future"]>]>;
307
364
  readonly severity: Schema.Literals<readonly ["error", "warning", "info"]>;
308
365
  readonly message: Schema.String;
309
366
  }>, {}>;
@@ -334,10 +391,19 @@ declare const IndexDocument_base: Schema.Class<IndexDocument, Schema.Struct<{
334
391
  readonly path: Schema.String;
335
392
  readonly dir: Schema.String;
336
393
  readonly okfVersion: Schema.optionalKey<Schema.String>;
394
+ readonly title: Schema.optionalKey<Schema.String>;
395
+ readonly description: Schema.optionalKey<Schema.String>;
396
+ readonly license: Schema.optionalKey<Schema.String>;
397
+ readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>;
398
+ readonly frontmatter: Schema.optionalKey<Schema.String>;
337
399
  readonly sections: Schema.$Array<typeof IndexSection>;
400
+ /** The file's text as the load read it (a leading byte-order mark dropped); absent on a hand-built document. */
401
+ readonly source: Schema.optionalKey<Schema.String>;
338
402
  }>, {}>;
339
403
  /**
340
- * A parsed `index.md` (D-21). `okfVersion` is present only on the bundle root.
404
+ * A parsed `index.md` (D-21). The metadata fields are present only on the bundle root (OKF 0.3 section 8.1):
405
+ * `okfVersion`, `title`, `description` and `license` are the typed reads, `metadata` is the whole decoded
406
+ * mapping (extension keys included) and `frontmatter` is the raw YAML text between the fences.
341
407
  * @public
342
408
  */
343
409
  export declare class IndexDocument extends IndexDocument_base {}
@@ -359,6 +425,8 @@ declare const LogDocument_base: Schema.Class<LogDocument, Schema.Struct<{
359
425
  readonly dir: Schema.String;
360
426
  readonly title: Schema.optionalKey<Schema.String>;
361
427
  readonly groups: Schema.$Array<typeof LogGroup>;
428
+ /** The file's text as the load read it (a leading byte-order mark dropped); absent on a hand-built document. */
429
+ readonly source: Schema.optionalKey<Schema.String>;
362
430
  }>, {}>;
363
431
  /**
364
432
  * A parsed `log.md` (D-21).
@@ -424,7 +492,7 @@ interface BundleLoadOptions {
424
492
  readonly includeHidden?: boolean;
425
493
  /** Directory levels below the root to descend; positive integer, default 256; exceeding it fails with `BundleDepthExceededError`. */
426
494
  readonly maxDepth?: number;
427
- /** Directory names never descended (default `["node_modules", ".git"]`). */
495
+ /** Directory names never descended (default `["node_modules", ".git"]`); a symbolic link with one of these names is skipped unread, while a regular file with one is still loaded. */
428
496
  readonly prune?: ReadonlyArray<string>;
429
497
  }
430
498
  declare const LoadedConcept_base: Schema.Class<LoadedConcept, Schema.Struct<{
@@ -442,7 +510,14 @@ declare const LoadedConcept_base: Schema.Class<LoadedConcept, Schema.Struct<{
442
510
  }>, {}>;
443
511
  /**
444
512
  * One concept file after loading: typed frontmatter, the parsed body, and the
445
- * `# Computation` section body when present (D-20).
513
+ * inline computation when present.
514
+ *
515
+ * @remarks
516
+ * `computationBody` is the inline form only. 0.3 or later: the code of the first fenced block in
517
+ * the first `Computation` section at any heading level (an empty fence yields an empty string; no
518
+ * fence is `None`). 0.2 or undeclared: the body of the depth-1 `Computation` section. When
519
+ * `attested.computation` is set, the file that path names is the computation (OKF 0.3 10.3 rule 1)
520
+ * and this field is not authoritative; core does not read that file.
446
521
  *
447
522
  * @public
448
523
  */
@@ -476,14 +551,94 @@ export declare class LoadedBundle extends LoadedBundle_base {}
476
551
  */
477
552
  export declare class Bundle {
478
553
  private constructor();
554
+ /**
555
+ * Parse Markdown text exactly as `Bundle.load` parses every bundle file (frontmatter on), so a tool that
556
+ * scans a file the loader did not keep as a concept reads its body the way a concept's is read.
557
+ */
558
+ static readonly parseDocument: (text: string) => Result.Result<MarkdownDocument, MarkdownParseError>;
559
+ /**
560
+ * Pure. The inline computation of `document` under one reading of the spec: `"legacy"` (OKF 0.2) is the body
561
+ * of the depth-1 `Computation` section, `"current"` (OKF 0.3 section 10.3) is the first fenced block of the
562
+ * first `Computation` section at any heading level. `None` when the reading finds nothing. `Bundle.load` calls
563
+ * this for the reading its bundle's declared version selects; a tool comparing the two readings calls it twice.
564
+ *
565
+ * @public
566
+ */
567
+ static readonly inlineComputation: (document: MarkdownDocument, reading: "legacy" | "current") => Option.Option<string>;
479
568
  /**
480
569
  * Load the bundle at `options.root` (D-8, D-9, D-11 to D-14, D-21). Content never
481
570
  * fails: every bad file becomes a diagnostic and loading continues (spec 8). A walk
482
571
  * that descends past `options.maxDepth` fails typed with `BundleDepthExceededError`
483
572
  * (W-1) rather than being silently truncated.
573
+ *
574
+ * A symbolic link is never followed out of the bundle (OKF 0.3 section 3.2 rule 5). A file link that leaves
575
+ * it, a directory link that leaves it (nothing under it is read), and a link of either kind whose resolution
576
+ * fails (dangling, a loop, an unreadable target) each record a `symlink-escape` warning at their own path
577
+ * (a pruned name, `node_modules` by default, is silent for a file link and a directory link alike and the link is never read; hidden names are checked only under `includeHidden`); a directory link that stays inside is never walked and
578
+ * records nothing. Each Markdown file is read confined (`readConfinedString`): a file that becomes a link out of
579
+ * the bundle between the link check and the read is refused as `symlink-escape`, and one that changed under the
580
+ * read (`changed`) is recorded `read-changed` ("try again") and left out of that load. A race through a directory above
581
+ * the file can still win (spencerbeggs/okfit#524).
484
582
  */
485
583
  static readonly load: (options: BundleLoadOptions) => Effect.Effect<LoadedBundle, BundleLoadError, FileSystem.FileSystem | Path.Path>;
486
584
  }
585
+ /**
586
+ * The transient wording every surface uses for a file that changed under a read: the quoted `subject` (a path or
587
+ * a concept file name) followed by `changed while it was read; try again`. One spelling, so the CLI, the MCP server
588
+ * and `ConfinementError` never drift. It is never an escape verdict.
589
+ *
590
+ * @public
591
+ */
592
+ export declare const changedWhileRead: (subject: string) => string;
593
+ declare const ConfinementError_base: Schema.Class<ConfinementError, Schema.TaggedStruct<"ConfinementError", {
594
+ readonly root: Schema.String;
595
+ /** The path that was read, as it was given. */
596
+ readonly path: Schema.String;
597
+ readonly reason: Schema.Literals<readonly ["outside", "unresolvable", "changed"]>;
598
+ }>, import("effect/Cause").YieldableError>;
599
+ /**
600
+ * A file read was refused (OKF 0.3 section 3.2).
601
+ *
602
+ * `reason` says why: `outside` (a link on the path resolves outside the root), `unresolvable` (a link on the path
603
+ * dangles or cannot be resolved) or `changed` (the path no longer names the file that was opened, or what it names
604
+ * could not be compared: it was swapped, replaced or removed while it was read, so reading again may succeed). Only
605
+ * `outside` and `unresolvable` mean the path leaves the bundle; `changed` is transient and never an escape verdict.
606
+ *
607
+ * @public
608
+ */
609
+ export declare class ConfinementError extends ConfinementError_base {
610
+ get message(): string;
611
+ }
612
+ /**
613
+ * Read the file `target` (an absolute path) under `root` confined to it, so a link swapped in after a check is not
614
+ * read: open the file, resolve the path with `confineReal` (every link on it, at the file or at a directory above
615
+ * it), require that the path still exists (`realPath`), then require that the open file is the file the resolved
616
+ * path names (`dev` and `ino` of the open file's `stat` against `lstat` of the real path, which must itself be a
617
+ * file and not a link). The bytes come from the open file, never from a second open of the path.
618
+ *
619
+ * The guarantee is exact about one case: a link at the file itself, swapped in at any moment during the read, is
620
+ * refused. A race through a directory above the file can still win, because the open and the resolution are
621
+ * separate steps on the path (spencerbeggs/okfit#524); there is no retry, which would only widen that window.
622
+ *
623
+ * It fails with {@link ConfinementError} (`outside` or `unresolvable` when a link on the path leaves the root or
624
+ * dangles; `changed` when the path no longer names the file that was opened, or either stat lacks an `ino`), and
625
+ * with the `PlatformError` of the open or the read otherwise. A missing file is that `PlatformError` (`NotFound`)
626
+ * unless a link on its path escapes or dangles. A hard link to a file under the root is a file under the root
627
+ * (OKF 0.3 section 3.2) and is read.
628
+ *
629
+ * Only reads are confined this way. A write stays a check followed by `writeAtomic`.
630
+ *
631
+ * @public
632
+ */
633
+ export declare const readConfinedBytes: (root: string, target: string) => Effect.Effect<Uint8Array<ArrayBuffer>, ConfinementError | import("effect/PlatformError").PlatformError, FileSystem.FileSystem | import("effect/Path").Path>;
634
+ /**
635
+ * {@link readConfinedBytes} decoded as UTF-8. A leading byte-order mark is dropped, as Effect's
636
+ * `FileSystem.readFileString` (a `TextDecoder`) drops it, so the loader reads a BOM file as it always did and a
637
+ * writer gives the BOM back.
638
+ *
639
+ * @public
640
+ */
641
+ export declare const readConfinedString: (root: string, target: string) => Effect.Effect<string, ConfinementError | import("effect/PlatformError").PlatformError, FileSystem.FileSystem | import("effect/Path").Path>;
487
642
  /**
488
643
  * Concept lifecycle status. Absent on a concept means `stable` (`Derive.status`).
489
644
  * @public
@@ -494,12 +649,28 @@ export declare const Status: Schema.Literals<readonly ["draft", "stable", "depre
494
649
  * @public
495
650
  */
496
651
  export type Status = typeof Status.Type;
497
- /** Trust tier from `verified` (OKF 0.2 §5.3): none maps to unverified; only non-human maps to machine-confirmed; any `human:` maps to human-reviewed. @public */
652
+ /**
653
+ * What `Derive.status` reads: the three known values, or `unknown` for a `status` outside the
654
+ * vocabulary (OKF 0.3 §5.4). `unknown` is never written; `Status` is the write vocabulary.
655
+ * @public
656
+ */
657
+ export declare const DerivedStatus: Schema.Literals<readonly ["draft", "stable", "deprecated", "unknown"]>;
658
+ /**
659
+ * The derived status value.
660
+ * @public
661
+ */
662
+ export type DerivedStatus = typeof DerivedStatus.Type;
663
+ /**
664
+ * Trust tier from the current `verified` events (OKF 0.3 §5.3, §7): no current event is unverified; current events
665
+ * none of which is `human:` (a `team:` or unknown scheme included) are machine-confirmed; any current `human:` event
666
+ * is human-reviewed. An event before the last `generated.at` is history: it stays in the file and counts for nothing.
667
+ * @public
668
+ */
498
669
  export declare const TrustTier: Schema.Literals<readonly ["unverified", "machine-confirmed", "human-reviewed"]>;
499
670
  /** @public */
500
671
  export type TrustTier = typeof TrustTier.Type;
501
- /** Three-way staleness; `unknown` means no `stale_after`. @public */
502
- export declare const Staleness: Schema.Literals<readonly ["fresh", "stale", "unknown"]>;
672
+ /** Staleness; `unknown` means no `stale_after`, `malformed` a `stale_after` okfit cannot read (OKF 0.3 §5.5). @public */
673
+ export declare const Staleness: Schema.Literals<readonly ["fresh", "stale", "unknown", "malformed"]>;
503
674
  /** @public */
504
675
  export type Staleness = typeof Staleness.Type;
505
676
  /** One dated `log.md` group to render. @public */
@@ -514,21 +685,77 @@ interface StaleConcept {
514
685
  /** Whole days between `staleAfter` and `now`, floored; never negative. */
515
686
  readonly daysPast: number;
516
687
  }
688
+ /** One concept whose `stale_after` is present but unreadable (OKF 0.3 §5.5): its id and the value as written. @public */
689
+ interface MalformedStaleAfter {
690
+ readonly id: ConceptId;
691
+ /** The `stale_after` value as written: the string itself, `JSON.stringify` for any other value. */
692
+ readonly raw: string;
693
+ }
517
694
  /** Options for {@link Derive.renderIndex}. @public */
518
695
  interface RenderIndexOptions {
519
- /** Emits a frontmatter block carrying only `okf_version` first; root index only (D-21). */
696
+ /**
697
+ * Emits a root frontmatter block first (root index only). Without `frontmatter` it carries only
698
+ * `okf_version` (D-21); with it, `okf_version` is added only when the kept block declares none.
699
+ */
520
700
  readonly okfVersion?: string;
701
+ /**
702
+ * The existing root block's YAML text (`IndexDocument.frontmatter`), re-emitted verbatim so a declared
703
+ * title, description, license, version or extension key survives a re-render (D6). `""` is absent.
704
+ */
705
+ readonly frontmatter?: string;
706
+ /**
707
+ * The bundle's `title` and `description` (OKF 0.3 §8.1), written after `okf_version` in a new root block.
708
+ * Ignored when `frontmatter` keeps an existing block: a kept block is never merged with it.
709
+ *
710
+ * @public
711
+ */
712
+ readonly metadata?: {
713
+ readonly title?: string;
714
+ readonly description?: string;
715
+ };
521
716
  /** Rendered as `* [name](name/index.md)` under a trailing `# Subdirectories` section. */
522
717
  readonly subdirectories?: ReadonlyArray<string>;
523
718
  }
524
719
  /** Pure derivations (D-10, D-36): trust tier, status, staleness against a supplied instant, index/log rendering. @public */
525
720
  export declare class Derive {
526
721
  private constructor();
527
- /** Any `human:` verifier means human-reviewed; otherwise machine-confirmed; none means unverified. */
722
+ /**
723
+ * Whether a verification event at `at` is current for `concept` (OKF 0.3 §5.3): `at` is equal to or later than
724
+ * `generated.at` by instant, or `generated` or `generated.at` is absent. It reads only `generated`, so a caller holding
725
+ * no whole concept passes `{ generated }`.
726
+ *
727
+ * @public
728
+ */
729
+ static readonly isCurrent: (concept: {
730
+ readonly generated?: {
731
+ readonly at?: DateTime.Utc;
732
+ } | undefined;
733
+ }, at: DateTime.Utc) => boolean;
734
+ /**
735
+ * The decoded `verified` entries that are current ({@link Derive.isCurrent}), in list order. Earlier events stay
736
+ * in the file as history (OKF 0.3 §5.3) and are not returned.
737
+ *
738
+ * @public
739
+ */
740
+ static readonly currentVerifications: (concept: Concept) => ReadonlyArray<Verification>;
741
+ /**
742
+ * The trust tier from {@link Derive.currentVerifications} only (OKF 0.3 §5.3, §7; §11.2 makes it a MUST for every
743
+ * bundle): none is unverified, any `human:` verifier is human-reviewed, otherwise machine-confirmed.
744
+ *
745
+ * @public
746
+ */
528
747
  static readonly trustTier: (concept: Concept) => TrustTier;
529
- /** Absent `status` reads as `stable` (OKF 0.2 §5.4). */
530
- static readonly status: (concept: Concept) => Status;
531
- /** `stale` when `now >= stale_after` (OKF 0.2 §5.5); `unknown` without `stale_after`. */
748
+ /**
749
+ * The typed status; `unknown` when `raw.status` is present (not `null`, `""` or `[]`) but outside the
750
+ * vocabulary; `stable` when absent (OKF 0.3 §5.4).
751
+ */
752
+ static readonly status: (concept: Concept) => DerivedStatus;
753
+ /** The `status` value as written, as text for display; `undefined` when absent, `null`, `""` or `[]`. */
754
+ static readonly rawStatus: (concept: Concept) => string | undefined;
755
+ /**
756
+ * `stale` when `now >= stale_after` (OKF 0.3 §5.5); `unknown` without `stale_after`; `malformed`
757
+ * when `raw.stale_after` is present (not `null`, `""` or `[]`) but unreadable, so never fresh and never stale.
758
+ */
532
759
  static readonly staleness: (concept: Concept, now: DateTime.Utc) => Staleness;
533
760
  /** Boolean form of {@link Derive.staleness} (D-36). */
534
761
  static readonly isStale: (concept: Concept, now: DateTime.Utc) => boolean;
@@ -538,7 +765,13 @@ export declare class Derive {
538
765
  * never read from a clock here (D-36).
539
766
  */
540
767
  static readonly staleReport: (bundle: LoadedBundle, now: DateTime.Utc) => ReadonlyArray<StaleConcept>;
541
- /** Frontmatter `title`, else the file name without `.md` (OKF 0.2 §4.1). */
768
+ /**
769
+ * Every concept in `bundle` whose {@link Derive.staleness} is `malformed` (OKF 0.3 §5.5: an unreadable
770
+ * `stale_after` is never fresh), with the value as written, sorted by id ascending. `staleReport` never
771
+ * lists these. A malformed value does not depend on the instant, so there is no `now` argument.
772
+ */
773
+ static readonly malformedStaleAfter: (bundle: LoadedBundle) => ReadonlyArray<MalformedStaleAfter>;
774
+ /** Frontmatter `title`, else the file name without `.md` (OKF 0.3 §4.1). */
542
775
  static readonly title: (concept: LoadedConcept) => string;
543
776
  /** One H1 per `type` (sorted), entries sorted by title, then `# Subdirectories` (D-36; spec §8). */
544
777
  static readonly renderIndex: (dir: string, concepts: ReadonlyArray<LoadedConcept>, options?: RenderIndexOptions) => string;
@@ -564,6 +797,38 @@ export declare class Derive {
564
797
  /** Index text for `dir` from the concepts directly in it plus its immediate child directories; no frontmatter. */
565
798
  static readonly synthesizeIndex: (bundle: LoadedBundle, dir: string) => string;
566
799
  }
800
+ /**
801
+ * How far past now a `generated.at` may sit before okfit treats it as a future stamp: five minutes, the allowance for
802
+ * ordinary clock skew between machines. The lint `generated-at-future` and the repair in `okfit sync` both read it
803
+ * through {@link generatedAtIsFuture}.
804
+ *
805
+ * @public
806
+ */
807
+ export declare const GENERATED_AT_TOLERANCE: Duration.Duration;
808
+ /**
809
+ * {@link GENERATED_AT_TOLERANCE} in words ("5 minutes"), for messages. Derived from the constant, so changing the
810
+ * tolerance changes every message that names it. The tolerance is a whole number of minutes.
811
+ *
812
+ * @public
813
+ */
814
+ export declare const GENERATED_AT_TOLERANCE_TEXT: string;
815
+ /**
816
+ * Whether `generatedAt` is more than {@link GENERATED_AT_TOLERANCE} later than `now`. Exactly the tolerance is not
817
+ * future; one millisecond more is.
818
+ *
819
+ * @public
820
+ */
821
+ export declare const generatedAtIsFuture: (generatedAt: DateTime.Utc, now: DateTime.Utc) => boolean;
822
+ /**
823
+ * The earliest verification time `V` with `startOf(now, "second") <= V < generatedAt`, the verifications that
824
+ * re-stamping `generatedAt` down to now would turn from not current into current (OKF 0.3 §5.3). `okfit sync` skips
825
+ * such a re-stamp; the lint `generated-at-future` names the verification instead of promising the repair. `now` is
826
+ * truncated to the whole second because stamps are written in whole seconds. None when no verification falls in the
827
+ * window.
828
+ *
829
+ * @public
830
+ */
831
+ export declare const verificationBlockingRestamp: (verifiedAts: ReadonlyArray<DateTime.Utc>, generatedAt: DateTime.Utc, now: DateTime.Utc) => Option.Option<DateTime.Utc>;
567
832
  /**
568
833
  * Kind of a graph node: a loaded concept, an existing non-concept file (including reserved
569
834
  * `index.md`/`log.md`), or a placeholder for a target that does not exist (D-25).
@@ -574,7 +839,7 @@ export declare const GraphNodeKind: Schema.Literals<readonly ["concept", "file",
574
839
  /** @public */
575
840
  export type GraphNodeKind = typeof GraphNodeKind.Type;
576
841
  /** Frontmatter fields whose value is a bundle path (D-23). @public */
577
- type PathField = "resource" | "sources.resource" | "computation" | "executor.resource" | "attester.resource";
842
+ type PathField = "resource" | "sources.resource" | "computation" | "executor.resource" | "attester.resource" | "superseded_by";
578
843
  /**
579
844
  * How one reference resolved (D-23, D-24); `via` says which D-23 branch produced a node: `rooted` (a leading
580
845
  * `/`), `file` (against the linking file's directory) or `root` (a bare path against the bundle root).
@@ -641,6 +906,13 @@ export declare class LinkGraph {
641
906
  toGraphViz(options?: Graph$1.GraphVizOptions<GraphNode, GraphEdge>): string;
642
907
  private neighbours;
643
908
  }
909
+ /**
910
+ * Which root-fallback rule {@link Graph.resolve} applies: `"declared"` follows the bundle's own `okf_version`,
911
+ * `"legacy"` forces the OKF 0.2 root fallback on and `"current"` forces it off, whatever the bundle declares.
912
+ *
913
+ * @public
914
+ */
915
+ type FallbackRule = "declared" | "legacy" | "current";
644
916
  /**
645
917
  * Static facade building a {@link LinkGraph} from a loaded bundle (D-6).
646
918
  *
@@ -650,9 +922,21 @@ export declare class Graph {
650
922
  private constructor();
651
923
  /**
652
924
  * Pure. Resolve `raw`, written in the file at bundle-relative `from`, the way the graph does; `field`
653
- * applies the path-field rules (a `sources.resource` descriptor).
925
+ * applies the path-field rules (a `sources.resource` descriptor). `rule` (default `"declared"`) states which
926
+ * root-fallback rule applies; it is applied per call and never cached.
927
+ */
928
+ static readonly resolve: (bundle: LoadedBundle, from: string, raw: string, field?: PathField, rule?: FallbackRule) => LinkResolution;
929
+ /**
930
+ * Pure. The concept that replaces a deprecated concept (OKF 0.3 section 5.4): follow `superseded_by` from `id`
931
+ * through deprecated concepts to the first concept whose derived status is neither `deprecated` nor `unknown`
932
+ * (a `draft` or `stable` concept is current knowledge). `None` when `id` is not a deprecated concept, a link
933
+ * resolves to a non-concept or a missing target, a deprecated concept has no `superseded_by`, the chain ends at
934
+ * an `unknown`-status concept, or the chain revisits a concept (a cycle or a self-reference). Resolution is the
935
+ * one {@link Graph.resolve} performs, so a bare value in a v0.2 bundle resolves through the root fallback.
936
+ *
937
+ * @public
654
938
  */
655
- static readonly resolve: (bundle: LoadedBundle, from: string, raw: string, field?: PathField) => LinkResolution;
939
+ static readonly replacement: (bundle: LoadedBundle, id: ConceptId) => Option.Option<ConceptId>;
656
940
  /**
657
941
  * Pure. Body links come from `document.links`, path fields from the frontmatter (D-23, D-24).
658
942
  * Placeholder `missing` nodes are added before their edge because `Graph.addEdge` throws on an absent endpoint.
@@ -726,6 +1010,7 @@ export declare const LintTable: Schema.Struct<{
726
1010
  readonly required_key_missing: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
727
1011
  readonly field_value_unknown: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
728
1012
  readonly require_verified_unmet: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
1013
+ readonly verified_before_change: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
729
1014
  readonly family_invalid: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
730
1015
  readonly computation_runtime_missing: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
731
1016
  readonly footnote_source_unknown: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
@@ -736,18 +1021,33 @@ export declare const LintTable: Schema.Struct<{
736
1021
  readonly verified_actor_unknown: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
737
1022
  readonly legacy_timestamp: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
738
1023
  readonly config_unknown_key: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
1024
+ readonly config_okf_version_stale: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
739
1025
  readonly stale: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
740
1026
  readonly walk_unreadable: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
1027
+ readonly read_changed: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
1028
+ readonly frontmatter_missing: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
1029
+ readonly type_missing: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
1030
+ readonly symlink_escape: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
741
1031
  readonly generated_at_drift: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
742
1032
  readonly verified_drift: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
743
1033
  readonly status_missing: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
744
1034
  readonly source_resource_missing: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
745
1035
  readonly resource_ignored: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
746
1036
  readonly resource_untracked: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
1037
+ readonly resource_outside_project: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
1038
+ readonly superseded_by_orphan: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
1039
+ readonly superseded_by_unresolved: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
747
1040
  readonly generated_missing: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
1041
+ readonly computation_missing: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
1042
+ readonly generated_at_future: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
748
1043
  readonly publication_drift: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
749
1044
  readonly publication_orphan: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
750
1045
  readonly surface_unmatched: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
1046
+ readonly index_metadata_invalid: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
1047
+ readonly entry_ignored: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
1048
+ readonly value_malformed: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
1049
+ readonly value_unknown: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
1050
+ readonly non_concept_unlisted: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
751
1051
  }>;
752
1052
  /**
753
1053
  * The `OkfitConfig` struct schema. Exported only so the `OkfitConfigFields`
@@ -760,6 +1060,7 @@ declare const okfitConfigFields: Schema.Struct<{
760
1060
  readonly bundle: Schema.optionalKey<Schema.Struct<{
761
1061
  readonly path: Schema.optionalKey<Schema.String>;
762
1062
  readonly profile: Schema.optionalKey<Schema.String>;
1063
+ readonly non_concepts: Schema.optionalKey<Schema.$Array<Schema.String>>;
763
1064
  }>>;
764
1065
  readonly concepts: Schema.optionalKey<Schema.Struct<{
765
1066
  readonly required: Schema.optionalKey<Schema.$Array<Schema.String>>;
@@ -781,6 +1082,7 @@ declare const okfitConfigFields: Schema.Struct<{
781
1082
  readonly required_key_missing: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
782
1083
  readonly field_value_unknown: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
783
1084
  readonly require_verified_unmet: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
1085
+ readonly verified_before_change: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
784
1086
  readonly family_invalid: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
785
1087
  readonly computation_runtime_missing: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
786
1088
  readonly footnote_source_unknown: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
@@ -791,18 +1093,33 @@ declare const okfitConfigFields: Schema.Struct<{
791
1093
  readonly verified_actor_unknown: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
792
1094
  readonly legacy_timestamp: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
793
1095
  readonly config_unknown_key: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
1096
+ readonly config_okf_version_stale: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
794
1097
  readonly stale: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
795
1098
  readonly walk_unreadable: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
1099
+ readonly read_changed: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
1100
+ readonly frontmatter_missing: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
1101
+ readonly type_missing: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
1102
+ readonly symlink_escape: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
796
1103
  readonly generated_at_drift: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
797
1104
  readonly verified_drift: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
798
1105
  readonly status_missing: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
799
1106
  readonly source_resource_missing: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
800
1107
  readonly resource_ignored: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
801
1108
  readonly resource_untracked: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
1109
+ readonly resource_outside_project: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
1110
+ readonly superseded_by_orphan: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
1111
+ readonly superseded_by_unresolved: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
802
1112
  readonly generated_missing: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
1113
+ readonly computation_missing: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
1114
+ readonly generated_at_future: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
803
1115
  readonly publication_drift: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
804
1116
  readonly publication_orphan: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
805
1117
  readonly surface_unmatched: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
1118
+ readonly index_metadata_invalid: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
1119
+ readonly entry_ignored: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
1120
+ readonly value_malformed: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
1121
+ readonly value_unknown: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
1122
+ readonly non_concept_unlisted: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
806
1123
  }>>;
807
1124
  readonly types: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
808
1125
  readonly description: Schema.optionalKey<Schema.String>;
@@ -868,6 +1185,7 @@ export declare const okfitConfigDocumentFields: Schema.StructWithRest<Schema.Str
868
1185
  readonly bundle: Schema.optionalKey<Schema.Struct<{
869
1186
  readonly path: Schema.optionalKey<Schema.String>;
870
1187
  readonly profile: Schema.optionalKey<Schema.String>;
1188
+ readonly non_concepts: Schema.optionalKey<Schema.$Array<Schema.String>>;
871
1189
  }>>;
872
1190
  readonly concepts: Schema.optionalKey<Schema.Struct<{
873
1191
  readonly required: Schema.optionalKey<Schema.$Array<Schema.String>>;
@@ -889,6 +1207,7 @@ export declare const okfitConfigDocumentFields: Schema.StructWithRest<Schema.Str
889
1207
  readonly required_key_missing: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
890
1208
  readonly field_value_unknown: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
891
1209
  readonly require_verified_unmet: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
1210
+ readonly verified_before_change: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
892
1211
  readonly family_invalid: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
893
1212
  readonly computation_runtime_missing: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
894
1213
  readonly footnote_source_unknown: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
@@ -899,18 +1218,33 @@ export declare const okfitConfigDocumentFields: Schema.StructWithRest<Schema.Str
899
1218
  readonly verified_actor_unknown: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
900
1219
  readonly legacy_timestamp: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
901
1220
  readonly config_unknown_key: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
1221
+ readonly config_okf_version_stale: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
902
1222
  readonly stale: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
903
1223
  readonly walk_unreadable: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
1224
+ readonly read_changed: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
1225
+ readonly frontmatter_missing: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
1226
+ readonly type_missing: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
1227
+ readonly symlink_escape: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
904
1228
  readonly generated_at_drift: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
905
1229
  readonly verified_drift: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
906
1230
  readonly status_missing: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
907
1231
  readonly source_resource_missing: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
908
1232
  readonly resource_ignored: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
909
1233
  readonly resource_untracked: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
1234
+ readonly resource_outside_project: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
1235
+ readonly superseded_by_orphan: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
1236
+ readonly superseded_by_unresolved: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
910
1237
  readonly generated_missing: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
1238
+ readonly computation_missing: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
1239
+ readonly generated_at_future: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
911
1240
  readonly publication_drift: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
912
1241
  readonly publication_orphan: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
913
1242
  readonly surface_unmatched: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
1243
+ readonly index_metadata_invalid: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
1244
+ readonly entry_ignored: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
1245
+ readonly value_malformed: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
1246
+ readonly value_unknown: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
1247
+ readonly non_concept_unlisted: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
914
1248
  }>>;
915
1249
  readonly types: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
916
1250
  readonly description: Schema.optionalKey<Schema.String>;
@@ -964,6 +1298,7 @@ declare const OkfitConfigFile_base: import("effect/Context").ServiceClass<OkfitC
964
1298
  readonly bundle?: {
965
1299
  readonly path?: string;
966
1300
  readonly profile?: string;
1301
+ readonly non_concepts?: readonly string[];
967
1302
  };
968
1303
  readonly concepts?: {
969
1304
  readonly required?: readonly string[];
@@ -985,6 +1320,7 @@ declare const OkfitConfigFile_base: import("effect/Context").ServiceClass<OkfitC
985
1320
  readonly required_key_missing?: "error" | "info" | "off" | "warn";
986
1321
  readonly field_value_unknown?: "error" | "info" | "off" | "warn";
987
1322
  readonly require_verified_unmet?: "error" | "info" | "off" | "warn";
1323
+ readonly verified_before_change?: "error" | "info" | "off" | "warn";
988
1324
  readonly family_invalid?: "error" | "info" | "off" | "warn";
989
1325
  readonly computation_runtime_missing?: "error" | "info" | "off" | "warn";
990
1326
  readonly footnote_source_unknown?: "error" | "info" | "off" | "warn";
@@ -995,18 +1331,33 @@ declare const OkfitConfigFile_base: import("effect/Context").ServiceClass<OkfitC
995
1331
  readonly verified_actor_unknown?: "error" | "info" | "off" | "warn";
996
1332
  readonly legacy_timestamp?: "error" | "info" | "off" | "warn";
997
1333
  readonly config_unknown_key?: "error" | "info" | "off" | "warn";
1334
+ readonly config_okf_version_stale?: "error" | "info" | "off" | "warn";
998
1335
  readonly stale?: "error" | "info" | "off" | "warn";
999
1336
  readonly walk_unreadable?: "error" | "info" | "off" | "warn";
1337
+ readonly read_changed?: "error" | "info" | "off" | "warn";
1338
+ readonly frontmatter_missing?: "error" | "info" | "off" | "warn";
1339
+ readonly type_missing?: "error" | "info" | "off" | "warn";
1340
+ readonly symlink_escape?: "error" | "info" | "off" | "warn";
1000
1341
  readonly generated_at_drift?: "error" | "info" | "off" | "warn";
1001
1342
  readonly verified_drift?: "error" | "info" | "off" | "warn";
1002
1343
  readonly status_missing?: "error" | "info" | "off" | "warn";
1003
1344
  readonly source_resource_missing?: "error" | "info" | "off" | "warn";
1004
1345
  readonly resource_ignored?: "error" | "info" | "off" | "warn";
1005
1346
  readonly resource_untracked?: "error" | "info" | "off" | "warn";
1347
+ readonly resource_outside_project?: "error" | "info" | "off" | "warn";
1348
+ readonly superseded_by_orphan?: "error" | "info" | "off" | "warn";
1349
+ readonly superseded_by_unresolved?: "error" | "info" | "off" | "warn";
1006
1350
  readonly generated_missing?: "error" | "info" | "off" | "warn";
1351
+ readonly computation_missing?: "error" | "info" | "off" | "warn";
1352
+ readonly generated_at_future?: "error" | "info" | "off" | "warn";
1007
1353
  readonly publication_drift?: "error" | "info" | "off" | "warn";
1008
1354
  readonly publication_orphan?: "error" | "info" | "off" | "warn";
1009
1355
  readonly surface_unmatched?: "error" | "info" | "off" | "warn";
1356
+ readonly index_metadata_invalid?: "error" | "info" | "off" | "warn";
1357
+ readonly entry_ignored?: "error" | "info" | "off" | "warn";
1358
+ readonly value_malformed?: "error" | "info" | "off" | "warn";
1359
+ readonly value_unknown?: "error" | "info" | "off" | "warn";
1360
+ readonly non_concept_unlisted?: "error" | "info" | "off" | "warn";
1010
1361
  };
1011
1362
  readonly types?: {
1012
1363
  readonly [x: string]: {
@@ -1047,6 +1398,32 @@ declare const OkfitConfigFile_base: import("effect/Context").ServiceClass<OkfitC
1047
1398
  * @public
1048
1399
  */
1049
1400
  export declare class OkfitConfigFile extends OkfitConfigFile_base {}
1401
+ /** A parsed OKF version: the numeric `<major>.<minor>` pair (OKF 0.3 §12). @public */
1402
+ interface OkfVersionNumber {
1403
+ readonly major: number;
1404
+ readonly minor: number;
1405
+ }
1406
+ /**
1407
+ * Reads and compares the OKF version a bundle declares. The declared version is the bundle-root
1408
+ * `index.md`'s `okf_version`; one gate, {@link OkfVersion.legacyFallbacks}, decides whether the v0.2
1409
+ * fallbacks apply. @public
1410
+ */
1411
+ export declare class OkfVersion {
1412
+ private constructor();
1413
+ /** Parses exactly `<major>.<minor>` (no `v`, no patch, no whitespace); anything else is `None`. */
1414
+ static readonly parse: (raw: string) => Option.Option<OkfVersionNumber>;
1415
+ /** Compares numerically, major first, so `0.10` sorts after `0.9`. */
1416
+ static readonly compare: (a: OkfVersionNumber, b: OkfVersionNumber) => -1 | 0 | 1;
1417
+ /**
1418
+ * The version the bundle-root `index.md` declares, as written; `None` when there is no root index or no `okf_version`.
1419
+ * An unquoted number is its source text (`0.10`, not `0.1`).
1420
+ */
1421
+ static readonly declared: (bundle: LoadedBundle) => Option.Option<string>;
1422
+ /** True when nothing is declared or the declared version parses and is 0.2 or earlier; an unparsable version reads as current. */
1423
+ static readonly allowsLegacyFallbacks: (declared: Option.Option<string>) => boolean;
1424
+ /** Whether the v0.2 fallbacks apply to this bundle: `allowsLegacyFallbacks(declared(bundle))`. */
1425
+ static readonly legacyFallbacks: (bundle: LoadedBundle) => boolean;
1426
+ }
1050
1427
  /**
1051
1428
  * A decoded OKF timestamp: always a UTC instant.
1052
1429
  * @public
@@ -1054,14 +1431,17 @@ export declare class OkfitConfigFile extends OkfitConfigFile_base {}
1054
1431
  export type Timestamp = DateTime.Utc;
1055
1432
  /**
1056
1433
  * ISO 8601 string with an explicit offset (`Z`, `+hh:mm` or `-hh:mm`) to `DateTime.Utc`.
1057
- * Offset-less input fails before parsing so its family surfaces as `family-invalid` (D-15/D-16).
1058
- * Encoding writes `2026-03-01T08:00:00Z` for a whole second and keeps non-zero milliseconds.
1434
+ * A date-only `YYYY-MM-DD` value (OKF 0.3 section 5) reads as the start of that day in UTC; an impossible
1435
+ * calendar day fails. Offset-less date-times fail before parsing and are reported as `value-malformed`.
1436
+ * Encoding always writes a date-time: `2026-03-01T08:00:00Z` for a whole second, non-zero milliseconds kept.
1059
1437
  * @public
1060
1438
  */
1061
1439
  export declare const Timestamp: Schema.Codec<DateTime.Utc, string>;
1062
1440
  /** Options for {@link Validate.lint}; `stale` fires only when `now` is supplied (D-34). @public */
1063
1441
  interface ValidateOptions {
1064
1442
  readonly now?: DateTime.Utc;
1443
+ /** The config file's path, printed in messages that name it; core reads nothing from it. */
1444
+ readonly configPath?: string;
1065
1445
  }
1066
1446
  /** Both tiers. Non-empty `conformance` means CLI exit 2; any `error` in `lint` means exit 1 (spec 3.4). @public */
1067
1447
  interface ValidationReport {
@@ -1083,6 +1463,6 @@ export declare class Validate {
1083
1463
  *
1084
1464
  * @public
1085
1465
  */
1086
- export declare const OKF_SPEC_VERSION: "0.2";
1087
- export type { ActorForm, BundleLoadError, BundleLoadOptions, GraphEdge, GraphLink, GraphNode, LinkResolution, LogEntry, OkfitConfigFields, PathField, RenderIndexOptions, StaleConcept, ValidateOptions, ValidationReport };
1466
+ export declare const OKF_SPEC_VERSION: "0.3";
1467
+ export type { ActorForm, BundleLoadError, BundleLoadOptions, EntryFamily, FallbackRule, GraphEdge, GraphLink, GraphNode, LinkResolution, LogEntry, MalformedStaleAfter, OkfVersionNumber, OkfitConfigFields, PathField, RenderIndexOptions, StaleConcept, ValidateOptions, ValidationReport };
1088
1468
  //# sourceMappingURL=index.d.ts.map