@okfit/engine 0.1.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 ADDED
@@ -0,0 +1,957 @@
1
+ import { BundleLoadError, ConceptId, Diagnostic, DiagnosticRange, DiagnosticSeverity, LoadedBundle, OkfitConfig, OkfitConfigFile, ValidationReport } from "@okfit/core";
2
+ import { Context, DateTime, Effect, FileSystem, Layer, Option, Path, PlatformError, Runtime, Schema } from "effect";
3
+ import { AppDirs, Xdg } from "@effected/xdg";
4
+ import { ConfigReadError } from "@effected/config-file";
5
+ import { GeneratedAtError, GitHistory, GitHistoryError, Layout, Profile, ProfileDiagnostic } from "@okfit/profiles";
6
+ import { FrontmatterWriteError, MarkdownParseError } from "@effected/markdown";
7
+ import * as NodeServices from "@effect/platform-node/NodeServices";
8
+ import { Git, GitCommandError, UnknownRefError } from "@effected/git";
9
+ //#region src/config/anchor.d.ts
10
+ /**
11
+ * What {@link resolveProjectRoot} needs about the winning discovery source
12
+ * (K-12, K-58). Narrower than `@effected/config-file`'s own
13
+ * `ConfigSource`: only `path`, `resolver` and the match's `dir` matter for
14
+ * anchoring, and a caller building this from a real
15
+ * `ConfigSource<OkfitConfig>` simply drops `value`.
16
+ *
17
+ * @public
18
+ */
19
+ interface DiscoveredConfig {
20
+ /** `ConfigSource.path` — absolute. */
21
+ readonly path: string;
22
+ /** `ConfigSource.resolver` — the resolver's `name`. */
23
+ readonly resolver: string;
24
+ /**
25
+ * `ConfigSource.match?.dir` — the ancestor directory `upwardWalk`
26
+ * anchored the winning candidate against. Absent when the resolver did
27
+ * not implement `resolveMatch`, or reported no `dir` (`explicitPath`
28
+ * never does, by design).
29
+ */
30
+ readonly dir?: string;
31
+ }
32
+ /**
33
+ * K-12's project root, as amended by K-58 and C1-2, in order:
34
+ *
35
+ * 1. `pathArg`, if given. `Argument.path` has already resolved it absolute.
36
+ * 2. otherwise, if `--config` was given: `anchorForExplicit` applied to that
37
+ * path.
38
+ * 3. otherwise, if a config was discovered by the `"project"` resolver
39
+ * (`ConfigResolver.upwardWalk`, named `"project"` in `layer.ts`) AND it
40
+ * reported a `dir`: that `dir` verbatim — it is already the ancestor
41
+ * `upwardWalk` anchored the match against (the parent of `.config` for a
42
+ * `.config/okfit.toml` candidate, the candidate's own directory
43
+ * otherwise), so no path-tail test is needed here any more.
44
+ * 4. otherwise `cwd` — this covers every other resolver name (`"xdg"`,
45
+ * `"native"`, `"system"`) as defence in depth, a `"project"` match with no
46
+ * `dir` (should not happen, since `upwardWalk` always reports one), and
47
+ * no discovery at all.
48
+ *
49
+ * The CLI never probes for `.git` (K-12), even though
50
+ * `ConfigResolver.gitRoot` exists.
51
+ *
52
+ * @public
53
+ */
54
+ export declare const resolveProjectRoot: (input: {
55
+ readonly pathArg: Option.Option<string>;
56
+ readonly explicitConfigPath: Option.Option<string>;
57
+ readonly discovered: Option.Option<DiscoveredConfig>;
58
+ readonly cwd: string;
59
+ readonly path: Path.Path;
60
+ }) => string;
61
+ /**
62
+ * `<project root>/<bundle.path>`, absolute (K-2). `config` is the MERGED
63
+ * config, so `bundle.path` is `OkfitConfig.DEFAULTS.bundle.path` (`"okf"`)
64
+ * unless a file or profile overrode it. The bundle root is never what
65
+ * `[path]` names.
66
+ *
67
+ * @public
68
+ */
69
+ export declare const resolveBundleRoot: (projectRoot: string, config: OkfitConfig, path: Path.Path) => string;
70
+ //#endregion
71
+ //#region src/errors.d.ts
72
+ declare const ConfigPathNotFoundError_base: Schema.Class<ConfigPathNotFoundError, Schema.TaggedStruct<"ConfigPathNotFoundError", {
73
+ readonly path: Schema.String;
74
+ }>, import("effect/Cause").YieldableError>;
75
+ /**
76
+ * `--config <path>` named a path that does not exist. Every `ConfigResolver`
77
+ * has a `never` error channel and `explicitPath` absorbs a missing target
78
+ * into `Option.none()`, so a bad `--config` would otherwise fall through to
79
+ * the XDG file silently. The CLI checks it itself before building any layer
80
+ * (K-1, spec 4.1).
81
+ *
82
+ * @public
83
+ */
84
+ export declare class ConfigPathNotFoundError extends ConfigPathNotFoundError_base {
85
+ readonly [Runtime.errorExitCode] = 3;
86
+ get message(): string;
87
+ }
88
+ declare const InitOverwriteError_base: Schema.Class<InitOverwriteError, Schema.TaggedStruct<"InitOverwriteError", {
89
+ readonly paths: Schema.$Array<Schema.String>;
90
+ readonly cwd: Schema.String;
91
+ }>, import("effect/Cause").YieldableError>;
92
+ /**
93
+ * `okfit init` found one or more of its target paths already present (K-28).
94
+ * Carries the whole conflicting-path list so the renderer prints every one.
95
+ * `paths` are absolute; `renderFailure` relativises them to `cwd` (K-51).
96
+ *
97
+ * @public
98
+ */
99
+ export declare class InitOverwriteError extends InitOverwriteError_base {
100
+ readonly [Runtime.errorExitCode] = 3;
101
+ get message(): string;
102
+ }
103
+ declare const VerifyConceptNotFoundError_base: Schema.Class<VerifyConceptNotFoundError, Schema.TaggedStruct<"VerifyConceptNotFoundError", {
104
+ readonly id: Schema.String;
105
+ readonly root: Schema.String;
106
+ readonly reason: Schema.Literals<readonly ["not-a-concept", "reserved", "undecodable"]>;
107
+ readonly diagnosticCode: Schema.optionalKey<Schema.String>;
108
+ }>, import("effect/Cause").YieldableError>;
109
+ /**
110
+ * V-9: `<id>` did not resolve to a verifiable concept. `reason` is
111
+ * `"not-a-concept"` (no such file, or an id that normalises to nothing),
112
+ * `"reserved"` (the id names `index.md` or `log.md`), or `"undecodable"`
113
+ * (a file exists but `bundle.diagnostics` names it — `diagnosticCode`
114
+ * carries which). `root` is the absolute bundle root, kept OFF `message`
115
+ * so K-51's relativisation rule has nothing to apply to and the human
116
+ * line and the JSON envelope's `message` are identical.
117
+ *
118
+ * @public
119
+ */
120
+ export declare class VerifyConceptNotFoundError extends VerifyConceptNotFoundError_base {
121
+ readonly [Runtime.errorExitCode] = 3;
122
+ get message(): string;
123
+ }
124
+ declare const VerifyUnsupportedFrontmatterError_base: Schema.Class<VerifyUnsupportedFrontmatterError, Schema.TaggedStruct<"VerifyUnsupportedFrontmatterError", {
125
+ readonly id: Schema.String;
126
+ readonly shape: Schema.String;
127
+ }>, import("effect/Cause").YieldableError>;
128
+ /**
129
+ * V-14: fail closed on a `verified` shape the classifier does not name.
130
+ * `shape` is one of `"alias"`, `"merge-key"`, `"scalar"`, `"empty"` (and,
131
+ * defensively, `"no-frontmatter"` or `"not-a-mapping"`, neither reachable
132
+ * for a concept that reached `bundle.concepts`). The file is never opened
133
+ * for writing when this is raised.
134
+ *
135
+ * @public
136
+ */
137
+ export declare class VerifyUnsupportedFrontmatterError extends VerifyUnsupportedFrontmatterError_base {
138
+ readonly [Runtime.errorExitCode] = 3;
139
+ get message(): string;
140
+ }
141
+ declare const ConfigMalformedError_base: Schema.Class<ConfigMalformedError, Schema.TaggedStruct<"ConfigMalformedError", {
142
+ readonly path: Schema.String;
143
+ readonly cause: Schema.Defect;
144
+ }>, import("effect/Cause").YieldableError>;
145
+ /**
146
+ * A config file at a KNOWN path failed to parse or validate (K-46's own
147
+ * intent — "each class' message already names the offending path" does not
148
+ * hold for `@effected/config-file`'s `ConfigCodecError`, which carries no
149
+ * `path` field at all; this wraps it, and `ConfigValidationError`, with the
150
+ * path the caller already knows). `cause` is the original config-file error,
151
+ * preserved structurally, never stringified early.
152
+ *
153
+ * @public
154
+ */
155
+ export declare class ConfigMalformedError extends ConfigMalformedError_base {
156
+ readonly [Runtime.errorExitCode] = 3;
157
+ get message(): string;
158
+ }
159
+ //#endregion
160
+ //#region src/config/layer.d.ts
161
+ /**
162
+ * The `OkfitConfigFile` layer for one invocation (K-9 to K-11, K-57, C-6),
163
+ * now one `AppConfig.layer(OkfitConfigFile, ...)` call in both branches; only
164
+ * the chain options vary:
165
+ *
166
+ * - `explicitConfigPath` is `Some`: `resolvers: [ConfigResolver.explicitPath(path)]`
167
+ * and `xdg: false` — K-10's "only that path" rule, so the chain is exactly
168
+ * one resolver and no `systemEtc` tier is added either.
169
+ * - `explicitConfigPath` is `None`: `resolvers: [ConfigResolver.upwardWalk({ filenames, ... })]`
170
+ * carrying C-1's three per-directory candidates (`.okfit.toml`,
171
+ * `okfit.toml`, `.config/okfit.toml`, directory-major so a child's later
172
+ * candidate beats a parent's earlier one — C-2's ascent to the filesystem
173
+ * root is `upwardWalk`'s own default with no `stopAt`), named `"project"`
174
+ * so `resolve.ts`/`anchor.ts` can identify it without string-matching a
175
+ * path tail. `systemEtc` is C-5's `/etc` tier, present unless
176
+ * `systemConfigDir` overrides its root (tests only — no production call
177
+ * site sets it). `xdg` and `native` stay on their defaults (C-4), which is
178
+ * what puts personal defaults at `$XDG_CONFIG_HOME/okfit/config.toml` and
179
+ * the native probe behind it.
180
+ *
181
+ * `filename: "config.toml"` is the same in both branches — it is the XDG/
182
+ * native/system tiers' filename, unrelated to the C-1 project names above.
183
+ * `defaultPath` is `AppConfig.layer`'s own `XdgConfig.savePath(filename)`, so
184
+ * `save`/`update` do not fail with `ConfigDefaultPathMissingError`; nothing
185
+ * here sets it explicitly any more.
186
+ *
187
+ * `discoveryCwd` is `[path]` when given, else `process.cwd()` (K-2), passed
188
+ * straight through as `upwardWalk`'s own `cwd` so nothing in this module
189
+ * reads the process.
190
+ *
191
+ * `App.layer`, `AppStore` and `AppCache` appear nowhere, so no
192
+ * `store.db`/`cache.db` is ever created (K-9).
193
+ *
194
+ * @public
195
+ */
196
+ export declare const buildConfigLayer: (options: {
197
+ readonly explicitConfigPath: Option.Option<string>;
198
+ readonly discoveryCwd: string;
199
+ /**
200
+ * System config root, defaulting to `/etc`. Overridable primarily so tests
201
+ * can point at a writable temp directory — the real `/etc` is not writable
202
+ * in test environments. No production call site sets it.
203
+ */
204
+ readonly systemConfigDir?: string;
205
+ }) => Layer.Layer<OkfitConfigFile, never, FileSystem.FileSystem | Path.Path | AppDirs | Xdg>;
206
+ /**
207
+ * The K-1 pre-flight and the provide, in that order and in one place: stat
208
+ * `explicitConfigPath` with `FileSystem.exists` and fail with
209
+ * `ConfigPathNotFoundError` BEFORE `buildConfigLayer` is called at all. This
210
+ * is why the CLI does not use `Command.provide(cmd, (input) => layer)`,
211
+ * which would construct the layer first (Judge notes 9) — here the stat
212
+ * runs as the first step of one `Effect.gen`, and `buildConfigLayer` is only
213
+ * reached, and only then actually run, on the step after it.
214
+ *
215
+ * `FileSystem.FileSystem.exists` is `(path: string) => Effect.Effect<boolean, PlatformError>`
216
+ * (`EF/FileSystem.ts:143-145`), not infallible, so
217
+ * `PlatformError.PlatformError` joins the error channel here (decision 7):
218
+ * an unusual stat failure (e.g. a permission error on a parent directory)
219
+ * renders through `renderFailure`'s catch-all rule rather than being
220
+ * uncatchable by the type checker.
221
+ *
222
+ * K-46/K-63 fix: a `ConfigCodecError`/`ConfigValidationError` from
223
+ * `buildConfigLayer`'s provided layer is wrapped into `ConfigMalformedError`
224
+ * whenever the failing path is known, so `renderFailure` can name it:
225
+ *
226
+ * - `ConfigCodecError` now carries its own `path: string | undefined`
227
+ * (config-file 0.7.0, `ConfigFile.discover` re-raises with `path` attached
228
+ * at every site that fed the codec a path it resolved) — used when
229
+ * present, so a malformed file found during DISCOVERY (no `--config`) now
230
+ * also wraps into `ConfigMalformedError` naming the candidate that failed,
231
+ * closing the K-63 gap. It falls back to `explicitConfigPath` only when
232
+ * the library's own `path` is `undefined` and `--config` was given; only
233
+ * when neither is known does the cause pass through unwrapped.
234
+ * - `ConfigValidationError` carries its own `path: Option<string>` — used
235
+ * when present (either branch), falling back to `explicitConfigPath` when
236
+ * the library's own `path` is `None` and `--config` was given.
237
+ *
238
+ * @public
239
+ */
240
+ export declare const provideConfig: (options: {
241
+ readonly explicitConfigPath: Option.Option<string>;
242
+ readonly discoveryCwd: string;
243
+ readonly systemConfigDir?: string;
244
+ }) => <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E | ConfigPathNotFoundError | ConfigMalformedError | PlatformError.PlatformError, Exclude<R, OkfitConfigFile> | FileSystem.FileSystem | Path.Path | AppDirs | Xdg>;
245
+ //#endregion
246
+ //#region src/config/resolve.d.ts
247
+ /**
248
+ * `OkfitConfig.DEFAULTS.bundle.profile` is `"software-project"` at runtime
249
+ * (the frozen literal always sets it), but `bundle` and `profile` are both
250
+ * `optionalKey` in the schema, so the type checker sees `string | undefined`
251
+ * two levels deep. The `?? "software-project"` fallback here is unreachable
252
+ * in practice; it exists only to satisfy `noUncheckedIndexedAccess`-style
253
+ * strictness without a non-null assertion. Formerly duplicated identically
254
+ * in `commands/validate.ts` and `commands/context.ts`; this is its one home
255
+ * now that both commands delegate to {@link resolveProjectConfig}.
256
+ *
257
+ * @public
258
+ */
259
+ export declare const DEFAULT_PROFILE_NAME: string;
260
+ /**
261
+ * Everything `validate` and `context`'s handlers derive from config
262
+ * discovery before diverging (contract §8.3): the merged config, the
263
+ * resolved profile (and its name after the "none"/default rule), the
264
+ * discovery source (if any), and the project/bundle roots.
265
+ *
266
+ * @public
267
+ */
268
+ interface ResolvedProjectConfig {
269
+ readonly projectRoot: string;
270
+ readonly bundleRoot: string;
271
+ readonly config: OkfitConfig;
272
+ readonly profile: Option.Option<Profile>;
273
+ readonly profileName: string;
274
+ readonly discovered: Option.Option<DiscoveredConfig>;
275
+ }
276
+ /**
277
+ * Input to {@link resolveProjectConfig}: the same three values every command
278
+ * handler already has in hand (its own `[path]` argument, its own
279
+ * `--config` flag, and `process.cwd()`) — nothing this function needs is
280
+ * read from `process` itself.
281
+ *
282
+ * @public
283
+ */
284
+ interface ResolveProjectConfigInput {
285
+ readonly pathArg: Option.Option<string>;
286
+ readonly explicitConfigPath: Option.Option<string>;
287
+ readonly cwd: string;
288
+ }
289
+ /**
290
+ * The config-resolution step byte-identical between `validate` and
291
+ * `context`'s handlers (A2 review finding): discover, pick `sources[0]`,
292
+ * default `{ extensions: {} }`, resolve the profile name and the K-4
293
+ * unknown-profile warning, merge `DEFAULTS < profile < file` (D-28), warn on
294
+ * an `okf_version` mismatch (K-15), then resolve the project and bundle
295
+ * roots (K-12). Every message string and the merge order are unchanged from
296
+ * the two commands' former inline copies.
297
+ *
298
+ * @public
299
+ */
300
+ export declare const resolveProjectConfig: (input: ResolveProjectConfigInput) => Effect.Effect<ResolvedProjectConfig, ConfigReadError, OkfitConfigFile | Path.Path>;
301
+ //#endregion
302
+ //#region src/context/run.d.ts
303
+ /** @public */
304
+ interface ContextRunOptions {
305
+ readonly bundleRoot: string;
306
+ }
307
+ /** @public */
308
+ interface ContextResult {
309
+ readonly indexPath: string;
310
+ readonly indexExists: boolean;
311
+ }
312
+ /**
313
+ * The whole of `context`'s filesystem work: join `index.md` onto the bundle
314
+ * root and stat it. Loading a bundle and running conformance/lint checks
315
+ * over it never happen here — that is what makes `context` cheap enough
316
+ * for a hook to run on every session start and every in-bundle write
317
+ * (M-15).
318
+ *
319
+ * `"index.md"` is a literal here, not read from the profile's layout: the
320
+ * spec fixes the reserved filename regardless of profile, and a
321
+ * profile-less merge (`profile = "none"`) has no layout to read from at
322
+ * all — `context` behaves identically with and without a profile.
323
+ *
324
+ * `exists` is `(path) => Effect.Effect<boolean, PlatformError>`, so an
325
+ * unreadable parent directory would otherwise fail the command; here it is
326
+ * absorbed to `false`, because "the hook could not stat index.md" and
327
+ * "index.md is not there" are the same fact from a consumer's point of
328
+ * view.
329
+ *
330
+ * @public
331
+ */
332
+ export declare const runContext: (options: ContextRunOptions) => Effect.Effect<ContextResult, never, FileSystem.FileSystem | Path.Path>;
333
+ //#endregion
334
+ //#region src/init/scaffold.d.ts
335
+ /** `.config/okfit.toml`, relative to the project root (C-10). @public */
336
+ export declare const CONFIG_RELATIVE_PATH = ".config/okfit.toml";
337
+ /** C-22's directive, plus the blank line Tombi requires. @public */
338
+ export declare const SCHEMA_DIRECTIVE = "#:schema https://raw.githubusercontent.com/spencerbeggs/okfit/main/schemas/config/okfit-1.0.0.json\n\n";
339
+ /** @public */
340
+ interface ScaffoldOptions {
341
+ /** Absolute. */
342
+ readonly projectRoot: string;
343
+ /** Absolute; `<projectRoot>/<bundle.path>`. */
344
+ readonly bundleRoot: string;
345
+ /** The resolved profile's `layout` (`PROFILES/Profile.ts:35-38`, P-26). */
346
+ readonly layout: Layout;
347
+ /** The name written into the config and the log entry. */
348
+ readonly profileName: string;
349
+ /** `basename(projectRoot)` — `project.md`'s `title` (K-26). */
350
+ readonly projectTitle: string;
351
+ /** `YYYY-MM-DD`, derived from the CLI's `now` (K-25, K-47). */
352
+ readonly today: string;
353
+ }
354
+ /** One file `init` will write. Pure data; this module imports no `FileSystem`. @public */
355
+ interface ScaffoldFile {
356
+ /** Absolute. */
357
+ readonly path: string;
358
+ readonly contents: string;
359
+ }
360
+ /**
361
+ * K-23: the THIN override only — never the merged config. `bundle.path` is
362
+ * the bundle root relative to the project root; `extensions: {}` satisfies
363
+ * `OkfitConfig`'s one non-optional field (`CORE/OkfitConfig.ts:164`).
364
+ * Everything else resolves from `DEFAULTS` and the profile at load time.
365
+ * `actors.agent` is deliberately absent (K-24, P-17).
366
+ *
367
+ * @public
368
+ */
369
+ export declare const configValue: (options: ScaffoldOptions & {
370
+ readonly bundlePath: string;
371
+ }) => OkfitConfig;
372
+ /**
373
+ * Every path `init` will create, absolute, in write order, for the K-28
374
+ * pre-flight: the three project-level config names, the bundle root's
375
+ * `index.md`/`log.md`/`project.md`, then one `index.md` per layout directory
376
+ * in `layout`'s own declared order — never re-sorted here. `Derive.renderIndex`
377
+ * sorts its own `Subdirectories` section independently (C13), so this
378
+ * function's order has no bearing on the rendered index text.
379
+ *
380
+ * @public
381
+ */
382
+ export declare const targetPaths: (options: ScaffoldOptions) => ReadonlyArray<string>;
383
+ /**
384
+ * The three root markdown files and the per-directory indexes (K-25 to
385
+ * K-27, K-59). `project.md`'s frontmatter is written with
386
+ * `MarkdownFrontmatter.setToString` — the INSERT path, since the body below
387
+ * carries no frontmatter block of its own (`MD/index.d.ts:1959`,
388
+ * `FrontmatterWriteError`'s own doc comment: "a document with no frontmatter
389
+ * capture is the insert path, not an error"). The root `index.md` is
390
+ * `Derive.renderIndex` over a `LoadedConcept` this function synthesizes from
391
+ * the just-rendered `project.md` text, re-parsed with `MarkdownDocument.parse`
392
+ * (K-59; `renderIndex` reads only `frontmatter.type`/`title`/`description`
393
+ * and `path`, never `document`, `CORE/Derive.ts:75-101`, so the synthesized
394
+ * value is faithful). Each per-directory `index.md` is the literal
395
+ * `# <Directory>` — NOT `Derive.renderIndex`, which returns the empty string
396
+ * for an empty concept list with no options (contract Judge notes item 2).
397
+ *
398
+ * @public
399
+ */
400
+ export declare const files: (options: ScaffoldOptions) => Effect.Effect<ReadonlyArray<ScaffoldFile>, MarkdownParseError | FrontmatterWriteError>;
401
+ //#endregion
402
+ //#region src/platform.d.ts
403
+ /**
404
+ * K-9/K-11: `AppDirs.layer(options)` requires `Xdg | FileSystem | Path`, so
405
+ * `Layer.provide(Xdg.layer)` alone does not close it.
406
+ * `Layer.provideMerge(NodeServices.layer)` supplies `FileSystem`/`Path` to
407
+ * both members and keeps every service in the output.
408
+ * `NodeServices.layer` provides `ChildProcessSpawner | Crypto | FileSystem | Path | Stdio | Terminal`,
409
+ * a superset of `Command.Environment`.
410
+ *
411
+ * K-13: `Xdg.layer` fails with `XdgEnvError` when `HOME` is unset. Callers
412
+ * are responsible for providing this layer INSIDE whatever region renders
413
+ * their failures, so that error is rendered rather than escaping to a
414
+ * fatal stack trace.
415
+ *
416
+ * @public
417
+ */
418
+ export declare const OkfitPlatform: Layer.Layer<AppDirs | Xdg | NodeServices.NodeServices, import("@effected/xdg").XdgEnvError, never>;
419
+ //#endregion
420
+ //#region src/render/context.d.ts
421
+ /** One `types[]` entry (M-15). @public */
422
+ export declare const ContextType: Schema.Struct<{
423
+ readonly name: Schema.String;
424
+ readonly description: Schema.NullOr<Schema.String>;
425
+ readonly guidance: Schema.NullOr<Schema.String>;
426
+ }>;
427
+ /** @public */
428
+ export type ContextType = typeof ContextType.Type;
429
+ /** One `tags[]` entry (M-15). @public */
430
+ export declare const ContextTag: Schema.Struct<{
431
+ readonly name: Schema.String;
432
+ readonly description: Schema.NullOr<Schema.String>;
433
+ }>;
434
+ /** @public */
435
+ export type ContextTag = typeof ContextTag.Type;
436
+ /**
437
+ * M-15's envelope: schema 1, snake_case, orientation data only. Distinct
438
+ * from `JsonEnvelope` (`render/json.ts`) — `context` never runs conformance
439
+ * or lint checks, so there is no `diagnostics` array and no `exit_code`
440
+ * field at all.
441
+ *
442
+ * Every field is `Schema.NullOr`, never `Schema.optionalKey`: a consumer
443
+ * (the two hook scripts) reads a fixed key set and gets JSON `null` for an
444
+ * absent value, rather than having to distinguish a missing key from a
445
+ * null one. This is a deliberate difference from `JsonDiagnostic`'s
446
+ * `range`, which is `optionalKey` and omitted when absent
447
+ * (`render/json.ts:14,68`).
448
+ *
449
+ * `profile_requested` (final-review Important 1) is the profile name the
450
+ * config asked for after the K-4 default rule — `resolveProjectConfig`'s
451
+ * own `profileName` — and is `null` only when no config file was found at
452
+ * all. `profile` keeps its original meaning (the resolved profile's name,
453
+ * or `null` when the requested name is unknown or `"none"`). The two
454
+ * differ exactly when a config named an unrecognised profile: `profile`
455
+ * is `null` but `profile_requested` still names what was asked for, so a
456
+ * consumer can tell "no profile configured" apart from "an unknown profile
457
+ * was configured".
458
+ *
459
+ * @public
460
+ */
461
+ export declare const ContextEnvelope: Schema.Struct<{
462
+ readonly schema: Schema.Literal<1>;
463
+ readonly project_root: Schema.String;
464
+ readonly bundle_root: Schema.String;
465
+ readonly config_path: Schema.NullOr<Schema.String>;
466
+ readonly profile: Schema.NullOr<Schema.String>;
467
+ readonly profile_requested: Schema.NullOr<Schema.String>;
468
+ readonly index_path: Schema.String;
469
+ readonly index_exists: Schema.Boolean;
470
+ readonly actors: Schema.Struct<{
471
+ readonly agent: Schema.NullOr<Schema.String>;
472
+ }>;
473
+ readonly types: Schema.$Array<Schema.Struct<{
474
+ readonly name: Schema.String;
475
+ readonly description: Schema.NullOr<Schema.String>;
476
+ readonly guidance: Schema.NullOr<Schema.String>;
477
+ }>>;
478
+ readonly tags: Schema.$Array<Schema.Struct<{
479
+ readonly name: Schema.String;
480
+ readonly description: Schema.NullOr<Schema.String>;
481
+ }>>;
482
+ }>;
483
+ /** @public */
484
+ export type ContextEnvelope = typeof ContextEnvelope.Type;
485
+ /**
486
+ * Build the envelope from the merged config. `types`/`tags` sort by `name`
487
+ * with plain code-unit comparison, never locale-dependent — the same rule
488
+ * `render/sort.ts`'s K-17 comparator and
489
+ * `packages/profiles/src/SoftwareProject.ts:119`'s own sort use.
490
+ *
491
+ * @public
492
+ */
493
+ export declare const contextEnvelope: (input: {
494
+ readonly projectRoot: string;
495
+ readonly bundleRoot: string;
496
+ readonly configPath: string | null;
497
+ readonly profile: string | null;
498
+ readonly profileRequested: string | null;
499
+ readonly indexPath: string;
500
+ readonly indexExists: boolean;
501
+ readonly config: OkfitConfig;
502
+ }) => ContextEnvelope;
503
+ //#endregion
504
+ //#region src/render/sort.d.ts
505
+ /** Which producer a diagnostic came from; the JSON envelope's `source` (K-21). @public */
506
+ type DiagnosticSource = "core.conformance" | "core.lint" | "profile";
507
+ /**
508
+ * The one shape both renderers consume. `file` is the bundle-relative posix
509
+ * path core produced, `""` for a bundle-level finding. `range` is core's own
510
+ * zero-based `DiagnosticRange` instance, passed through untouched (K-21).
511
+ * `code` is widened to `string`: core's `DiagnosticCode`
512
+ * (`CORE/Diagnostic.ts:45-46`) and profiles' `ProfileDiagnosticCode`
513
+ * (`PROFILES/Profile.ts:47`) are disjoint closed unions and this carries
514
+ * either.
515
+ *
516
+ * @public
517
+ */
518
+ interface RenderedDiagnostic {
519
+ readonly source: DiagnosticSource;
520
+ readonly file: string;
521
+ readonly range?: DiagnosticRange;
522
+ readonly code: string;
523
+ readonly severity: DiagnosticSeverity;
524
+ readonly message: string;
525
+ }
526
+ /**
527
+ * Tag core's two arrays and profiles' one, in producer order. Not named
528
+ * `merge`: `OkfitConfig.merge` already owns that word in this codebase.
529
+ *
530
+ * @public
531
+ */
532
+ export declare const collect: (conformance: ReadonlyArray<Diagnostic>, lint: ReadonlyArray<Diagnostic>, profile: ReadonlyArray<ProfileDiagnostic>) => ReadonlyArray<RenderedDiagnostic>;
533
+ /**
534
+ * K-17: `file` ascending (so `""` — the bundle-level finding — leads), then
535
+ * range-less before ranged within a file, then `range.offset` ascending, then
536
+ * `code`. Plain code-unit comparison, never locale-dependent (the same rule
537
+ * profiles' own `check` sorts by, `PROFILES/SoftwareProject.ts:119`). Stable:
538
+ * implemented with `toSorted`, which is specified as stable.
539
+ *
540
+ * @public
541
+ */
542
+ export declare const sort: (diagnostics: ReadonlyArray<RenderedDiagnostic>) => ReadonlyArray<RenderedDiagnostic>;
543
+ //#endregion
544
+ //#region src/render/exit.d.ts
545
+ /** @public */
546
+ interface Tally {
547
+ readonly conformanceErrors: number;
548
+ readonly lintErrors: number;
549
+ readonly lintWarnings: number;
550
+ readonly lintInfo: number;
551
+ readonly profileErrors: number;
552
+ }
553
+ /**
554
+ * One pass over the collected diagnostics. `core.conformance` entries are
555
+ * always severity `error` (D-33); the counts are still taken from `severity`
556
+ * so a future non-error conformance code cannot silently change the exit
557
+ * code.
558
+ *
559
+ * @public
560
+ */
561
+ export declare const tally: (diagnostics: ReadonlyArray<RenderedDiagnostic>) => Tally;
562
+ /**
563
+ * K-7/K-8's two lowest tiers: `2` when any conformance error is present, else
564
+ * `1` when any lint OR profile error is present, else `0`. Warnings and info
565
+ * never move it. `130`, `64` and `3` are set elsewhere — by the runtime's
566
+ * interrupt branch, by the `ShowHelp` remap in `bin.ts`, and by the typed
567
+ * errors' own `[Runtime.errorExitCode]` — so this function returns only
568
+ * `0 | 1 | 2`.
569
+ *
570
+ * @public
571
+ */
572
+ export declare const forDiagnostics: (diagnostics: ReadonlyArray<RenderedDiagnostic>) => 0 | 1 | 2;
573
+ //#endregion
574
+ //#region src/render/json.d.ts
575
+ /** One entry of the `diagnostics` array (K-21). @public */
576
+ export declare const JsonDiagnostic: Schema.Struct<{
577
+ readonly source: Schema.Literals<readonly ["core.conformance", "core.lint", "profile"]>;
578
+ readonly file: Schema.String;
579
+ readonly code: Schema.String;
580
+ readonly severity: Schema.Literals<readonly ["error", "warning", "info"]>;
581
+ readonly message: Schema.String;
582
+ readonly range: Schema.optionalKey<typeof DiagnosticRange>;
583
+ }>;
584
+ /** @public */
585
+ export type JsonDiagnostic = typeof JsonDiagnostic.Type;
586
+ /** @public */
587
+ export declare const JsonSummary: Schema.Struct<{
588
+ readonly conformance_errors: Schema.Number;
589
+ readonly lint_errors: Schema.Number;
590
+ readonly lint_warnings: Schema.Number;
591
+ readonly lint_info: Schema.Number;
592
+ readonly profile_errors: Schema.Number;
593
+ readonly concepts: Schema.Number;
594
+ }>;
595
+ /** @public */
596
+ export type JsonSummary = typeof JsonSummary.Type;
597
+ /**
598
+ * K-21's success envelope, snake_case. `exit_code` is `0 | 1 | 2` only: an
599
+ * infrastructure failure never produces this envelope, it produces the
600
+ * `JsonErrorEnvelope` (K-22).
601
+ *
602
+ * @public
603
+ */
604
+ export declare const JsonEnvelope: Schema.Struct<{
605
+ readonly schema: Schema.Literal<1>;
606
+ readonly okfit_version: Schema.String;
607
+ readonly okf_version: Schema.String;
608
+ readonly root: Schema.String;
609
+ readonly profile: Schema.NullOr<Schema.String>;
610
+ readonly exit_code: Schema.Literals<readonly [0, 1, 2]>;
611
+ readonly summary: Schema.Struct<{
612
+ readonly conformance_errors: Schema.Number;
613
+ readonly lint_errors: Schema.Number;
614
+ readonly lint_warnings: Schema.Number;
615
+ readonly lint_info: Schema.Number;
616
+ readonly profile_errors: Schema.Number;
617
+ readonly concepts: Schema.Number;
618
+ }>;
619
+ readonly diagnostics: Schema.$Array<Schema.Struct<{
620
+ readonly source: Schema.Literals<readonly ["core.conformance", "core.lint", "profile"]>;
621
+ readonly file: Schema.String;
622
+ readonly code: Schema.String;
623
+ readonly severity: Schema.Literals<readonly ["error", "warning", "info"]>;
624
+ readonly message: Schema.String;
625
+ readonly range: Schema.optionalKey<typeof DiagnosticRange>;
626
+ }>>;
627
+ }>;
628
+ /** @public */
629
+ export type JsonEnvelope = typeof JsonEnvelope.Type;
630
+ /** K-22's envelope: the ONLY thing stdout carries under `--format json` on an exit-3 failure. @public */
631
+ export declare const JsonErrorEnvelope: Schema.Struct<{
632
+ readonly schema: Schema.Literal<1>;
633
+ readonly okfit_version: Schema.String;
634
+ readonly exit_code: Schema.Literal<3>;
635
+ readonly error: Schema.Struct<{
636
+ readonly tag: Schema.String;
637
+ readonly message: Schema.String;
638
+ }>;
639
+ }>;
640
+ /** @public */
641
+ export type JsonErrorEnvelope = typeof JsonErrorEnvelope.Type;
642
+ /**
643
+ * Build the success envelope. `diagnostics` is sorted here with the same
644
+ * `sort` the human renderer uses (K-21's "diagnostics are in the K-17
645
+ * order"); `range` passes through as core computed it, zero-based.
646
+ *
647
+ * The value returned is in `Type` form (its `range`s are `DiagnosticRange`
648
+ * instances). What stdout carries is `Schema.encodeSync(JsonEnvelope)` of it,
649
+ * `JSON.stringify`-ed — one document, no trailing text.
650
+ *
651
+ * @public
652
+ */
653
+ export declare const json: (input: {
654
+ readonly okfitVersion: string;
655
+ readonly okfVersion: string;
656
+ readonly root: string;
657
+ readonly profile: string | null;
658
+ readonly exitCode: 0 | 1 | 2;
659
+ readonly concepts: number;
660
+ readonly diagnostics: ReadonlyArray<RenderedDiagnostic>;
661
+ }) => JsonEnvelope;
662
+ /** K-22. `tag` is the error's `_tag` when it has one, else its constructor name. @public */
663
+ export declare const jsonError: (error: unknown, okfitVersion: string) => JsonErrorEnvelope;
664
+ //#endregion
665
+ //#region src/sync/run.d.ts
666
+ /** The three families `okfit sync` regenerates (contract §5). @public */
667
+ type SyncMode = "generated" | "index" | "log";
668
+ /**
669
+ * S-14: a closed union, not free text. The human renderer maps each member
670
+ * to one fixed sentence (`render/sync.ts#humanSync`); the JSON envelope's
671
+ * `skipped[].reason` is this exact union.
672
+ *
673
+ * @public
674
+ */
675
+ export declare const SkipReason: Schema.Literals<readonly ["untracked", "dirty", "unborn", "generated-missing", "generated-unsupported", "log-unparseable"]>;
676
+ /** @public */
677
+ export type SkipReason = typeof SkipReason.Type;
678
+ /** @public */
679
+ interface SyncOptions {
680
+ /** Absolute bundle root, from `resolveProjectConfig`. */
681
+ readonly bundleRoot: string;
682
+ /** Already merged `DEFAULTS < profile < file` by the caller (D-28); unused today (`sync` never calls `profile.check`) but carried for parity with `RunOptions`. */
683
+ readonly config: OkfitConfig;
684
+ /** Members to actually RUN. Absent members still appear in {@link SyncResult}, `selected: false`. */
685
+ readonly modes: ReadonlySet<SyncMode>;
686
+ readonly dryRun: boolean;
687
+ }
688
+ /** @public */
689
+ interface SyncModeResult {
690
+ readonly selected: boolean;
691
+ /** Bundle-relative. `generated`'s ids have no `.md`; `index`/`log`'s paths do (design §2). */
692
+ readonly written: ReadonlyArray<string>;
693
+ readonly unchanged: ReadonlyArray<string>;
694
+ readonly skipped: ReadonlyArray<{
695
+ readonly id: string;
696
+ readonly reason: SkipReason;
697
+ }>;
698
+ }
699
+ /** @public */
700
+ interface SyncResult {
701
+ readonly bundleRoot: string;
702
+ readonly dryRun: boolean;
703
+ readonly generated: SyncModeResult;
704
+ readonly index: SyncModeResult;
705
+ readonly log: SyncModeResult;
706
+ }
707
+ /**
708
+ * Contract §5's six-step algorithm: one `Bundle.load`, one
709
+ * `Derivation.generatedAt` per concept shared by the generated and log
710
+ * modes (skipped entirely when neither is selected), then the three modes
711
+ * in a FIXED order — generated, index, log — regardless of `--only`'s own
712
+ * occurrence order, so a generated write never invalidates an index or log
713
+ * rendered in the same run (design §2).
714
+ *
715
+ * @public
716
+ */
717
+ export declare const runSync: (options: SyncOptions) => Effect.Effect<SyncResult, BundleLoadError | GeneratedAtError, Git | GitHistory | FileSystem.FileSystem | Path.Path>;
718
+ //#endregion
719
+ //#region src/render/sync.d.ts
720
+ /** @public */
721
+ export declare const SyncModeEnvelope: Schema.Struct<{
722
+ readonly selected: Schema.Boolean;
723
+ readonly written: Schema.$Array<Schema.String>;
724
+ readonly unchanged: Schema.$Array<Schema.String>;
725
+ readonly skipped: Schema.$Array<Schema.Struct<{
726
+ readonly id: Schema.String;
727
+ readonly reason: Schema.Literals<readonly ["untracked", "dirty", "unborn", "generated-missing", "generated-unsupported", "log-unparseable"]>;
728
+ }>>;
729
+ }>;
730
+ /** @public */
731
+ export type SyncModeEnvelope = typeof SyncModeEnvelope.Type;
732
+ /**
733
+ * Contract §14 note 5: `schema: 1` is INFERRED, not in the design's own
734
+ * §2 JSON example — every other envelope in this codebase
735
+ * (`JsonEnvelope`, `VerifyEnvelope`, `ContextEnvelope`) opens with it, so
736
+ * this one does too. `exit_code` is the literal `0`: `sync` has no
737
+ * content tier (unlike `validate`'s `0 | 1 | 2`) and this envelope only
738
+ * exists on the success path — a failure produces `JsonErrorEnvelope`
739
+ * (K-22) instead, unchanged.
740
+ *
741
+ * @public
742
+ */
743
+ export declare const SyncEnvelope: Schema.Struct<{
744
+ readonly schema: Schema.Literal<1>;
745
+ readonly okfit_version: Schema.String;
746
+ readonly root: Schema.String;
747
+ readonly dry_run: Schema.Boolean;
748
+ readonly exit_code: Schema.Literal<0>;
749
+ readonly generated: Schema.Struct<{
750
+ readonly selected: Schema.Boolean;
751
+ readonly written: Schema.$Array<Schema.String>;
752
+ readonly unchanged: Schema.$Array<Schema.String>;
753
+ readonly skipped: Schema.$Array<Schema.Struct<{
754
+ readonly id: Schema.String;
755
+ readonly reason: Schema.Literals<readonly ["untracked", "dirty", "unborn", "generated-missing", "generated-unsupported", "log-unparseable"]>;
756
+ }>>;
757
+ }>;
758
+ readonly index: Schema.Struct<{
759
+ readonly selected: Schema.Boolean;
760
+ readonly written: Schema.$Array<Schema.String>;
761
+ readonly unchanged: Schema.$Array<Schema.String>;
762
+ readonly skipped: Schema.$Array<Schema.Struct<{
763
+ readonly id: Schema.String;
764
+ readonly reason: Schema.Literals<readonly ["untracked", "dirty", "unborn", "generated-missing", "generated-unsupported", "log-unparseable"]>;
765
+ }>>;
766
+ }>;
767
+ readonly log: Schema.Struct<{
768
+ readonly selected: Schema.Boolean;
769
+ readonly written: Schema.$Array<Schema.String>;
770
+ readonly unchanged: Schema.$Array<Schema.String>;
771
+ readonly skipped: Schema.$Array<Schema.Struct<{
772
+ readonly id: Schema.String;
773
+ readonly reason: Schema.Literals<readonly ["untracked", "dirty", "unborn", "generated-missing", "generated-unsupported", "log-unparseable"]>;
774
+ }>>;
775
+ }>;
776
+ }>;
777
+ /** @public */
778
+ export type SyncEnvelope = typeof SyncEnvelope.Type;
779
+ /**
780
+ * `root` alone goes through `displayRoot` at the call site
781
+ * (`commands/sync.ts`) — `generated`/`index`/`log`'s own lists are
782
+ * already bundle-relative and need no cwd-relativisation (contract §9.1).
783
+ *
784
+ * @public
785
+ */
786
+ export declare const syncEnvelope: (input: {
787
+ readonly okfitVersion: string;
788
+ readonly root: string;
789
+ readonly dryRun: boolean;
790
+ readonly result: SyncResult;
791
+ }) => SyncEnvelope;
792
+ //#endregion
793
+ //#region src/render/verify.d.ts
794
+ /**
795
+ * V-11's success envelope, schema 1, snake_case — the same convention as
796
+ * `render/json.ts`'s `JsonEnvelope`. Identical in shape for a dry run,
797
+ * which sets `dry_run: true` and still exits 0. There is no content tier,
798
+ * so `exit_code` is the literal `0`; a failure produces K-22's
799
+ * `JsonErrorEnvelope` instead, unchanged.
800
+ *
801
+ * @public
802
+ */
803
+ export declare const VerifyEnvelope: Schema.Struct<{
804
+ readonly schema: Schema.Literal<1>;
805
+ readonly okfit_version: Schema.String;
806
+ readonly id: Schema.String;
807
+ readonly path: Schema.String;
808
+ readonly verified: Schema.Struct<{
809
+ readonly by: Schema.String;
810
+ readonly at: Schema.String;
811
+ }>;
812
+ readonly dry_run: Schema.Boolean;
813
+ readonly exit_code: Schema.Literal<0>;
814
+ }>;
815
+ /** @public */
816
+ export type VerifyEnvelope = typeof VerifyEnvelope.Type;
817
+ /**
818
+ * `path` is already the display form — `displayRoot(cwd, bundle.root, path)`
819
+ * joined to the bundle-relative `concept.path` — because `LoadedConcept.path`
820
+ * alone would print `decisions/cli-exit-codes.md`, not
821
+ * `okf/decisions/cli-exit-codes.md` (contract §12 note 5).
822
+ *
823
+ * @public
824
+ */
825
+ export declare const verifyEnvelope: (input: {
826
+ readonly okfitVersion: string;
827
+ readonly id: string;
828
+ readonly path: string;
829
+ readonly by: string;
830
+ readonly at: string;
831
+ readonly dryRun: boolean;
832
+ }) => VerifyEnvelope;
833
+ //#endregion
834
+ //#region src/validate/run.d.ts
835
+ declare const Now_base: Context.ServiceClass<Now, "@okfit/engine/Now", DateTime.Utc>;
836
+ /**
837
+ * K-47's ambient clock. `bin.ts` resolves `OKFIT_NOW` (or the wall clock)
838
+ * exactly once and provides it with `Effect.provideService(Now, value)`
839
+ * around the whole command tree; `commands/validate.ts` and
840
+ * `commands/init.ts` each read it with `const now = yield* Now;` before
841
+ * building {@link RunOptions} or a scaffold's `today`. Not re-exported from
842
+ * `index.ts`: like `internal/exit.ts` and `internal/tty.ts`, it means
843
+ * nothing outside a spawned process (K-49). `Context.Tag` does not exist on
844
+ * the Effect v4 line; the v4 shape is
845
+ * `Context.Service<Self, Shape>()(id)`, the same form core and profiles use
846
+ * for their own services (`PROFILES/GitHistory.ts:140`) — source wins over
847
+ * the contract's literal snippet here (K-62).
848
+ *
849
+ * @internal
850
+ */
851
+ export declare class Now extends Now_base {}
852
+ /** @public */
853
+ interface RunOptions {
854
+ /** Absolute bundle root; `Bundle.load` never reads cwd (D-8). */
855
+ readonly root: string;
856
+ /** Already merged `DEFAULTS < profile < file` by the caller (D-28). */
857
+ readonly config: OkfitConfig;
858
+ /** The resolved profile, when `Profiles.get` found one. */
859
+ readonly profile: Option.Option<Profile>;
860
+ /** `OKFIT_NOW` or `DateTime.now`, from `bin.ts` (K-47); enables the `stale` rule (D-34). */
861
+ readonly now: DateTime.Utc;
862
+ /**
863
+ * S-31: skip `Provenance.lint`'s git tier for this one invocation,
864
+ * without touching the project's `[lint]` table. `commands/validate.ts`
865
+ * threads `--skip-provenance` here; the PostToolUse hook passes the flag
866
+ * so an edit-time `validate` stays git-free even when the config leaves
867
+ * `generated-at-drift` at its default severity. Defaults to `false`, and
868
+ * is checked the same way `severity === "off"` already is — `run` skips
869
+ * the walk when EITHER is true.
870
+ */
871
+ readonly skipProvenance?: boolean;
872
+ }
873
+ /** @public */
874
+ interface RunResult {
875
+ readonly bundle: LoadedBundle;
876
+ readonly report: ValidationReport;
877
+ /** `[]` when `profile` is `None`. */
878
+ readonly profileDiagnostics: ReadonlyArray<ProfileDiagnostic>;
879
+ }
880
+ /**
881
+ * Load, validate both tiers, run the profile check, then — UNLESS the
882
+ * `generated-at-drift` lint is `off` OR `options.skipProvenance` is `true`
883
+ * — run `Provenance.lint` and append its `Diagnostic`s to `report.lint`.
884
+ * The "skip the git walk entirely" gate lives HERE, in `run`, not inside
885
+ * `Provenance.lint` (S-8's own wording): a bundle configured `off`, or a
886
+ * caller that passed `--skip-provenance`, never pays for a git spawn
887
+ * (S-31). An `error` severity on the appended diagnostics yields exit `1`
888
+ * through the EXISTING lint-tier rule in `render/exit.ts` — no renderer
889
+ * branch, no new `DiagnosticSource`, since these diagnostics flow through
890
+ * the same `report.lint` array every other core lint diagnostic already
891
+ * does.
892
+ *
893
+ * K-52 holds structurally: `Bundle.load`'s failure short-circuits the
894
+ * generator, so `profile.check` never runs on a bundle that did not load.
895
+ *
896
+ * This is a BREAKING signature change: `@okfit/mcp`'s `validateBundle.ts`
897
+ * calls this function directly and must be updated to match (Task C1);
898
+ * `commands/validate.ts` is the other caller.
899
+ *
900
+ * @public
901
+ */
902
+ export declare const run: (options: RunOptions) => Effect.Effect<RunResult, BundleLoadError | GitHistoryError | GitCommandError | UnknownRefError | PlatformError.PlatformError, FileSystem.FileSystem | Path.Path | Git | GitHistory>;
903
+ //#endregion
904
+ //#region src/verify/run.d.ts
905
+ /** @internal */
906
+ interface VerifyOptions {
907
+ readonly id: string;
908
+ /** Absolute bundle root, from `resolveProjectConfig`. */
909
+ readonly bundleRoot: string;
910
+ /** Absolute project root — V-7 spells `generatedBy`'s cwd as exactly this. */
911
+ readonly projectRoot: string;
912
+ /** Already merged `DEFAULTS < profile < file` by the caller (D-28). */
913
+ readonly config: OkfitConfig;
914
+ /** `--at` when given, else the `Now` service (K-47/K-49). */
915
+ readonly at: DateTime.Utc;
916
+ readonly dryRun: boolean;
917
+ }
918
+ /** @internal */
919
+ interface VerifyResult {
920
+ readonly id: string;
921
+ /** Absolute bundle root, echoed back for `displayRoot`. */
922
+ readonly bundleRoot: string;
923
+ /** Posix bundle-relative path with `.md`, straight off `LoadedConcept.path`. */
924
+ readonly conceptPath: string;
925
+ /** The branded actor string, e.g. `human:spencer`. */
926
+ readonly by: string;
927
+ /** The `Timestamp`-encoded ISO string actually recorded. */
928
+ readonly at: string;
929
+ /** Every PRIOR entry by this same actor, in list order, encoded (V-2). */
930
+ readonly priorAt: ReadonlyArray<string>;
931
+ readonly dryRun: boolean;
932
+ /** The exact bytes `splice`'s edit would insert, written or not. */
933
+ readonly fragment: string;
934
+ }
935
+ /**
936
+ * Contract §2.3 steps 6–15. Loads the bundle, resolves the id, resolves the
937
+ * human actor from git, splices exactly one entry into the concept's
938
+ * frontmatter and writes it back atomically.
939
+ *
940
+ * Nothing here reads `status`, `stale_after`, or a type's
941
+ * `require_verified`: `verify` is mechanical, not config-aware (V-4, V-5).
942
+ *
943
+ * @internal
944
+ */
945
+ export declare const runVerify: (options: VerifyOptions) => Effect.Effect<{
946
+ id: ConceptId;
947
+ bundleRoot: string;
948
+ conceptPath: string;
949
+ by: import("@okfit/core").Actor;
950
+ at: string;
951
+ priorAt: string[];
952
+ dryRun: boolean;
953
+ fragment: string;
954
+ }, 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>;
955
+ //#endregion
956
+ export type { ContextResult, ContextRunOptions, DiagnosticSource, DiscoveredConfig, RenderedDiagnostic, ResolveProjectConfigInput, ResolvedProjectConfig, RunOptions, RunResult, ScaffoldFile, ScaffoldOptions, SyncMode, SyncModeResult, SyncOptions, SyncResult, Tally, VerifyOptions, VerifyResult };
957
+ //# sourceMappingURL=index.d.ts.map