@okfit/core 0.5.0 → 0.7.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/Diagnostic.js +2 -1
- package/OkfitConfig.js +52 -3
- package/README.md +1 -1
- package/index.d.ts +43 -3
- package/index.js +2 -2
- package/internal/lintRules.js +3 -1
- package/package.json +2 -1
package/Diagnostic.js
CHANGED
|
@@ -39,7 +39,8 @@ const LintCode = Schema.Literals([
|
|
|
39
39
|
"walk-unreadable",
|
|
40
40
|
"generated-at-drift",
|
|
41
41
|
"status-missing",
|
|
42
|
-
"source-resource-missing"
|
|
42
|
+
"source-resource-missing",
|
|
43
|
+
"generated-missing"
|
|
43
44
|
]);
|
|
44
45
|
/** @public */
|
|
45
46
|
const DiagnosticCode = Schema.Union([ConformanceCode, LintCode]);
|
package/OkfitConfig.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Actor } from "./Actor.js";
|
|
2
2
|
import { Duration, Effect, Option, Schema, SchemaGetter, SchemaIssue, SchemaTransformation } from "effect";
|
|
3
3
|
import { ConfigFile, TomlCodec } from "@effected/config-file";
|
|
4
|
+
import { HostedSchema } from "@effected/schemastore";
|
|
4
5
|
|
|
5
6
|
//#region src/OkfitConfig.ts
|
|
6
7
|
/**
|
|
@@ -219,6 +220,11 @@ const LintTable = Schema.Struct({
|
|
|
219
220
|
title: "source-resource-missing",
|
|
220
221
|
description: "A resource or sources[].resource path resolves neither in the bundle nor on disk relative to the concept (issue #106). Default \"warn\".",
|
|
221
222
|
default: "warn"
|
|
223
|
+
})),
|
|
224
|
+
generated_missing: Schema.optionalKey(LintLevel.annotate({
|
|
225
|
+
title: "generated-missing",
|
|
226
|
+
description: "A concept has no generated block while actors.agent is configured, so okfit sync cannot stamp generated.at until the block exists (issue #73). Default \"warn\"; silent when actors.agent is unset.",
|
|
227
|
+
default: "warn"
|
|
222
228
|
}))
|
|
223
229
|
}).annotate({
|
|
224
230
|
title: "Lint severities",
|
|
@@ -300,6 +306,47 @@ const okfitConfigFields = Schema.Struct({
|
|
|
300
306
|
extensions: Schema.Record(Schema.String, Schema.Unknown)
|
|
301
307
|
});
|
|
302
308
|
/**
|
|
309
|
+
* The version of the config JSON Schema {@link okfitConfigDocumentFields}
|
|
310
|
+
* describes, `major.minor` only (no patch segment). Core owns this number
|
|
311
|
+
* because it owns the shape: an additive optional key is a minor bump, a
|
|
312
|
+
* removed or retyped key is a major bump. {@link okfitConfigSchemaHost}
|
|
313
|
+
* derives its published `versions` from this constant rather than
|
|
314
|
+
* restating it, so the two can never disagree; `pnpm schema:check`'s DRIFT
|
|
315
|
+
* check refuses a published document that no longer matches this struct
|
|
316
|
+
* (okfit #137).
|
|
317
|
+
*
|
|
318
|
+
* @public
|
|
319
|
+
*/
|
|
320
|
+
const CONFIG_SCHEMA_VERSION = "1.0";
|
|
321
|
+
/**
|
|
322
|
+
* Where the published `config` JSON Schema document lives and which
|
|
323
|
+
* version is current — the one identity `lib/configs/schemastore.config.ts`
|
|
324
|
+
* and `@okfit/engine`'s `init` (the `#:schema` directive, via
|
|
325
|
+
* {@link SCHEMA_DIRECTIVE}) both derive from, so the URL a fresh config
|
|
326
|
+
* points at and the one the generated document declares can never disagree
|
|
327
|
+
* (C-18). `versions` derives from {@link CONFIG_SCHEMA_VERSION} (okfit
|
|
328
|
+
* #137) rather than restating the number, so this host and the CLI's
|
|
329
|
+
* `--version` `config-schema` segment can never drift apart. Core owns
|
|
330
|
+
* this identity because it owns the shape and the version; engine's `init`
|
|
331
|
+
* only consumes it (C-22).
|
|
332
|
+
*
|
|
333
|
+
* @public
|
|
334
|
+
*/
|
|
335
|
+
const okfitConfigSchemaHost = HostedSchema.github({
|
|
336
|
+
repo: "spencerbeggs/okfit",
|
|
337
|
+
path: "schemas",
|
|
338
|
+
name: "config",
|
|
339
|
+
versions: ["1.0"],
|
|
340
|
+
appendVersion: false
|
|
341
|
+
});
|
|
342
|
+
/**
|
|
343
|
+
* C-22's directive `okfit init` writes ahead of a fresh config file, plus
|
|
344
|
+
* the blank line Tombi requires.
|
|
345
|
+
*
|
|
346
|
+
* @public
|
|
347
|
+
*/
|
|
348
|
+
const SCHEMA_DIRECTIVE = `#:schema ${okfitConfigSchemaHost.$id}\n\n`;
|
|
349
|
+
/**
|
|
303
350
|
* The schema the published JSON Schema document is generated from (C-15):
|
|
304
351
|
* `okfitConfigFields` minus `extensions` (wire bookkeeping no human writes),
|
|
305
352
|
* with an open rest so unknown top-level keys are permitted at the root while
|
|
@@ -392,7 +439,8 @@ const LINT_KEY = {
|
|
|
392
439
|
"walk-unreadable": "walk_unreadable",
|
|
393
440
|
"generated-at-drift": "generated_at_drift",
|
|
394
441
|
"status-missing": "status_missing",
|
|
395
|
-
"source-resource-missing": "source_resource_missing"
|
|
442
|
+
"source-resource-missing": "source_resource_missing",
|
|
443
|
+
"generated-missing": "generated_missing"
|
|
396
444
|
};
|
|
397
445
|
const DEFAULT_LINT = {
|
|
398
446
|
broken_links: "warn",
|
|
@@ -413,7 +461,8 @@ const DEFAULT_LINT = {
|
|
|
413
461
|
walk_unreadable: "warn",
|
|
414
462
|
generated_at_drift: "warn",
|
|
415
463
|
status_missing: "off",
|
|
416
|
-
source_resource_missing: "warn"
|
|
464
|
+
source_resource_missing: "warn",
|
|
465
|
+
generated_missing: "warn"
|
|
417
466
|
};
|
|
418
467
|
const toSeverity = (level) => level === "warn" ? "warning" : level;
|
|
419
468
|
const severityFor = (config, code) => {
|
|
@@ -489,4 +538,4 @@ const OkfitConfig = Object.assign(OkfitConfigWire, {
|
|
|
489
538
|
var OkfitConfigFile = class extends ConfigFile.Service()("@okfit/core/OkfitConfigFile") {};
|
|
490
539
|
|
|
491
540
|
//#endregion
|
|
492
|
-
export { FieldDeclaration, LintLevel, LintTable, OkfitConfig, OkfitConfigFile, StaleAfterDuration, TagDeclaration, TypeDeclaration, okfitConfigDocumentFields, okfitConfigFields };
|
|
541
|
+
export { CONFIG_SCHEMA_VERSION, FieldDeclaration, LintLevel, LintTable, OkfitConfig, OkfitConfigFile, SCHEMA_DIRECTIVE, StaleAfterDuration, TagDeclaration, TypeDeclaration, okfitConfigDocumentFields, okfitConfigFields, okfitConfigSchemaHost };
|
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ const program = Effect.gen(function* () {
|
|
|
23
23
|
});
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
`Bundle.load` needs `FileSystem` and `Path`; `OkfitConfig.read` needs `FileSystem`. Loading never fails on content: bad files become `Diagnostic`s. `Graph.fromBundle` treats a path-valued field or link whose target, resolved from its concept's directory, lands outside the bundle root as an external reference: no graph node and no `broken-links` diagnostic, exactly like a URL. `OkfitConfig` decodes the spec 4.2 TOML shape; unknown top-level keys are kept in `extensions` and reported by `Validate.lint` as `config-unknown-key`. `lifecycle.default_stale_after` accepts `90d`, `12h`, `2w`, or `"90 days"`. `OkfitConfig.merge` deep-merges tables; arrays and scalars in `override` replace wholesale. Apply `DEFAULTS < profile < file` yourself. `OkfitConfigFile` is the service tag; the CLI provides its layer. `okfitConfigDocumentFields` is `okfitConfigFields` minus `extensions` (wire bookkeeping no human writes), with an open rest so unknown top-level keys stay permitted while every declared table stays closed; it is the single source `lib/
|
|
26
|
+
`Bundle.load` needs `FileSystem` and `Path`; `OkfitConfig.read` needs `FileSystem`. Loading never fails on content: bad files become `Diagnostic`s. `Graph.fromBundle` treats a path-valued field or link whose target, resolved from its concept's directory, lands outside the bundle root as an external reference: no graph node and no `broken-links` diagnostic, exactly like a URL. `OkfitConfig` decodes the spec 4.2 TOML shape; unknown top-level keys are kept in `extensions` and reported by `Validate.lint` as `config-unknown-key`. `lifecycle.default_stale_after` accepts `90d`, `12h`, `2w`, or `"90 days"`. `OkfitConfig.merge` deep-merges tables; arrays and scalars in `override` replace wholesale. Apply `DEFAULTS < profile < file` yourself. `OkfitConfigFile` is the service tag; the CLI provides its layer. `okfitConfigDocumentFields` is `okfitConfigFields` minus `extensions` (wire bookkeeping no human writes), with an open rest so unknown top-level keys stay permitted while every declared table stays closed; it is the single source `@okfit/engine`'s `lib/configs/schemastore.config.ts` builds the published JSON Schema (`schemas/1.0/config.json`) from via `@effected/schemastore-cli`, and carries no annotations of its own beyond what each field already declares in `OkfitConfig.ts`. The document's `HostedSchema` identity (`okfitConfigSchemaHost`, the same `$id` `okfit init` stamps into a fresh config's `#:schema` directive) lives in `@okfit/engine`, not here — core stays free of a runtime `@effected/schemastore` dependency. The `[lint]` table's seventeen keys include `generated_at_drift` (default `"warn"`), which fires when a committed concept's `generated.at` no longer matches the instant its body was last changed AND is not otherwise authoritative (issue #19: a stamp recorded during the unchanged-body run survives a squash/rebase merge) — computed by `okfit sync`/`okfit validate`, never by core itself.
|
|
27
27
|
|
|
28
28
|
## License
|
|
29
29
|
|
package/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Brand, DateTime, Duration, Effect, FileSystem, Graph as Graph$1, Option, Path, Schema } from "effect";
|
|
2
2
|
import { MarkdownDocument } from "@effected/markdown";
|
|
3
3
|
import { ConfigReadError } from "@effected/config-file";
|
|
4
|
+
import { HostedSchema } from "@effected/schemastore";
|
|
4
5
|
//#region src/Actor.d.ts
|
|
5
6
|
/**
|
|
6
7
|
* An OKF actor string: `<producer>/<version>`, `human:<id>`, `process:<id>`,
|
|
@@ -206,11 +207,11 @@ export declare const ConformanceCode: Schema.Literals<readonly ["frontmatter-mis
|
|
|
206
207
|
/** @public */
|
|
207
208
|
export type ConformanceCode = typeof ConformanceCode.Type;
|
|
208
209
|
/** Severity from `OkfitConfig` (D-34). @public */
|
|
209
|
-
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"]>;
|
|
210
|
+
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"]>;
|
|
210
211
|
/** @public */
|
|
211
212
|
export type LintCode = typeof LintCode.Type;
|
|
212
213
|
/** @public */
|
|
213
|
-
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"]>]>;
|
|
214
|
+
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"]>]>;
|
|
214
215
|
/** @public */
|
|
215
216
|
export type DiagnosticCode = typeof DiagnosticCode.Type;
|
|
216
217
|
declare const DiagnosticRange_base: Schema.Class<DiagnosticRange, Schema.Struct<{
|
|
@@ -230,7 +231,7 @@ export declare class DiagnosticRange extends DiagnosticRange_base {
|
|
|
230
231
|
declare const Diagnostic_base: Schema.Class<Diagnostic, Schema.Struct<{
|
|
231
232
|
readonly file: Schema.String;
|
|
232
233
|
readonly range: Schema.optionalKey<typeof DiagnosticRange>;
|
|
233
|
-
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"]>]>;
|
|
234
|
+
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"]>]>;
|
|
234
235
|
readonly severity: Schema.Literals<readonly ["error", "warning", "info"]>;
|
|
235
236
|
readonly message: Schema.String;
|
|
236
237
|
}>, {}>;
|
|
@@ -649,6 +650,7 @@ export declare const LintTable: Schema.Struct<{
|
|
|
649
650
|
readonly generated_at_drift: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
650
651
|
readonly status_missing: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
651
652
|
readonly source_resource_missing: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
653
|
+
readonly generated_missing: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
652
654
|
}>;
|
|
653
655
|
/**
|
|
654
656
|
* The `OkfitConfig` struct schema. Exported only so the `OkfitConfigFields`
|
|
@@ -698,6 +700,7 @@ declare const okfitConfigFields: Schema.Struct<{
|
|
|
698
700
|
readonly generated_at_drift: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
699
701
|
readonly status_missing: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
700
702
|
readonly source_resource_missing: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
703
|
+
readonly generated_missing: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
701
704
|
}>>;
|
|
702
705
|
readonly types: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
|
|
703
706
|
readonly description: Schema.optionalKey<Schema.String>;
|
|
@@ -715,6 +718,41 @@ declare const okfitConfigFields: Schema.Struct<{
|
|
|
715
718
|
}>>>;
|
|
716
719
|
readonly extensions: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
717
720
|
}>;
|
|
721
|
+
/**
|
|
722
|
+
* The version of the config JSON Schema {@link okfitConfigDocumentFields}
|
|
723
|
+
* describes, `major.minor` only (no patch segment). Core owns this number
|
|
724
|
+
* because it owns the shape: an additive optional key is a minor bump, a
|
|
725
|
+
* removed or retyped key is a major bump. {@link okfitConfigSchemaHost}
|
|
726
|
+
* derives its published `versions` from this constant rather than
|
|
727
|
+
* restating it, so the two can never disagree; `pnpm schema:check`'s DRIFT
|
|
728
|
+
* check refuses a published document that no longer matches this struct
|
|
729
|
+
* (okfit #137).
|
|
730
|
+
*
|
|
731
|
+
* @public
|
|
732
|
+
*/
|
|
733
|
+
export declare const CONFIG_SCHEMA_VERSION: "1.0";
|
|
734
|
+
/**
|
|
735
|
+
* Where the published `config` JSON Schema document lives and which
|
|
736
|
+
* version is current — the one identity `lib/configs/schemastore.config.ts`
|
|
737
|
+
* and `@okfit/engine`'s `init` (the `#:schema` directive, via
|
|
738
|
+
* {@link SCHEMA_DIRECTIVE}) both derive from, so the URL a fresh config
|
|
739
|
+
* points at and the one the generated document declares can never disagree
|
|
740
|
+
* (C-18). `versions` derives from {@link CONFIG_SCHEMA_VERSION} (okfit
|
|
741
|
+
* #137) rather than restating the number, so this host and the CLI's
|
|
742
|
+
* `--version` `config-schema` segment can never drift apart. Core owns
|
|
743
|
+
* this identity because it owns the shape and the version; engine's `init`
|
|
744
|
+
* only consumes it (C-22).
|
|
745
|
+
*
|
|
746
|
+
* @public
|
|
747
|
+
*/
|
|
748
|
+
export declare const okfitConfigSchemaHost: HostedSchema;
|
|
749
|
+
/**
|
|
750
|
+
* C-22's directive `okfit init` writes ahead of a fresh config file, plus
|
|
751
|
+
* the blank line Tombi requires.
|
|
752
|
+
*
|
|
753
|
+
* @public
|
|
754
|
+
*/
|
|
755
|
+
export declare const SCHEMA_DIRECTIVE: string;
|
|
718
756
|
/**
|
|
719
757
|
* The schema the published JSON Schema document is generated from (C-15):
|
|
720
758
|
* `okfitConfigFields` minus `extensions` (wire bookkeeping no human writes),
|
|
@@ -765,6 +803,7 @@ export declare const okfitConfigDocumentFields: Schema.StructWithRest<Schema.Str
|
|
|
765
803
|
readonly generated_at_drift: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
766
804
|
readonly status_missing: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
767
805
|
readonly source_resource_missing: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
806
|
+
readonly generated_missing: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
768
807
|
}>>;
|
|
769
808
|
readonly types: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
|
|
770
809
|
readonly description: Schema.optionalKey<Schema.String>;
|
|
@@ -852,6 +891,7 @@ declare const OkfitConfigFile_base: import("effect/Context").ServiceClass<OkfitC
|
|
|
852
891
|
readonly generated_at_drift?: "error" | "info" | "off" | "warn";
|
|
853
892
|
readonly status_missing?: "error" | "info" | "off" | "warn";
|
|
854
893
|
readonly source_resource_missing?: "error" | "info" | "off" | "warn";
|
|
894
|
+
readonly generated_missing?: "error" | "info" | "off" | "warn";
|
|
855
895
|
};
|
|
856
896
|
readonly types?: {
|
|
857
897
|
readonly [x: string]: {
|
package/index.js
CHANGED
|
@@ -13,7 +13,7 @@ import { LogDocument, LogGroup, LogItem } from "./LogDocument.js";
|
|
|
13
13
|
import { Bundle, BundleDepthExceededError, BundleReadError, BundleRootNotFoundError, LoadedBundle, LoadedConcept } from "./Bundle.js";
|
|
14
14
|
import { Derive, Staleness, TrustTier } from "./Derive.js";
|
|
15
15
|
import { Graph, GraphNodeKind, LinkGraph } from "./Graph.js";
|
|
16
|
-
import { FieldDeclaration, LintLevel, LintTable, OkfitConfig, OkfitConfigFile, StaleAfterDuration, TagDeclaration, TypeDeclaration, okfitConfigDocumentFields } from "./OkfitConfig.js";
|
|
16
|
+
import { CONFIG_SCHEMA_VERSION, FieldDeclaration, LintLevel, LintTable, OkfitConfig, OkfitConfigFile, SCHEMA_DIRECTIVE, StaleAfterDuration, TagDeclaration, TypeDeclaration, okfitConfigDocumentFields, okfitConfigSchemaHost } from "./OkfitConfig.js";
|
|
17
17
|
import { Validate } from "./Validate.js";
|
|
18
18
|
|
|
19
19
|
//#region src/index.ts
|
|
@@ -25,4 +25,4 @@ import { Validate } from "./Validate.js";
|
|
|
25
25
|
const OKF_SPEC_VERSION = "0.2";
|
|
26
26
|
|
|
27
27
|
//#endregion
|
|
28
|
-
export { ATTESTED_COMPUTATION_TYPE, Actor, AttestedComputation, BodySha256, Bundle, BundleDepthExceededError, BundleReadError, BundleRootNotFoundError, ComputationAttester, ComputationExecutor, ComputationParameter, Concept, ConceptId, ConformanceCode, Derive, Diagnostic, DiagnosticCode, DiagnosticRange, DiagnosticSeverity, FieldDeclaration, Generated, Graph, GraphNodeKind, IndexDocument, IndexEntry, IndexSection, LinkGraph, LintCode, LintLevel, LintTable, LoadedBundle, LoadedConcept, LogDocument, LogGroup, LogItem, OKF_SPEC_VERSION, OkfitConfig, OkfitConfigFile, Source, StaleAfterDuration, Staleness, Status, TagDeclaration, Timestamp, TrustTier, TypeDeclaration, UsageWindow, Validate, Verification, okfitConfigDocumentFields };
|
|
28
|
+
export { ATTESTED_COMPUTATION_TYPE, Actor, AttestedComputation, BodySha256, Bundle, BundleDepthExceededError, BundleReadError, BundleRootNotFoundError, CONFIG_SCHEMA_VERSION, ComputationAttester, ComputationExecutor, ComputationParameter, Concept, ConceptId, ConformanceCode, Derive, Diagnostic, DiagnosticCode, DiagnosticRange, DiagnosticSeverity, FieldDeclaration, Generated, Graph, GraphNodeKind, IndexDocument, IndexEntry, IndexSection, LinkGraph, LintCode, LintLevel, LintTable, LoadedBundle, LoadedConcept, LogDocument, LogGroup, LogItem, OKF_SPEC_VERSION, OkfitConfig, OkfitConfigFile, SCHEMA_DIRECTIVE, Source, StaleAfterDuration, Staleness, Status, TagDeclaration, Timestamp, TrustTier, TypeDeclaration, UsageWindow, Validate, Verification, okfitConfigDocumentFields, okfitConfigSchemaHost };
|
package/internal/lintRules.js
CHANGED
|
@@ -52,6 +52,7 @@ const fieldValueUnknown = perConcept("field-value-unknown", (concept, context) =
|
|
|
52
52
|
});
|
|
53
53
|
const requireVerifiedUnmet = perConcept("require-verified-unmet", (concept, context) => context.config.types?.[concept.frontmatter.type]?.require_verified === true && concept.frontmatter.status !== "draft" && (concept.frontmatter.verified ?? []).length === 0 ? [`Type "${concept.frontmatter.type}" requires a verified entry`] : []);
|
|
54
54
|
const statusMissing = perConcept("status-missing", (concept) => concept.frontmatter.status === void 0 && (concept.frontmatter.verified ?? []).length === 0 ? ["Concept has no status and no verified entry, so it reads as stable; set status: draft or stable explicitly"] : []);
|
|
55
|
+
const generatedMissing = perConcept("generated-missing", (concept, context) => context.config.actors?.agent !== void 0 && !present(concept.frontmatter.raw, "generated") ? [`Concept has no generated block; okfit sync will create it from actors.agent (${context.config.actors.agent}) once the body is committed, or set generated.by by hand`] : []);
|
|
55
56
|
const actorPrefixUnknown = perConcept("actor-prefix-unknown", (concept) => {
|
|
56
57
|
return [concept.frontmatter.generated?.by, ...(concept.frontmatter.verified ?? []).map((v) => v.by)].filter((by) => by !== void 0 && Actor.form(by) === "other").map((by) => `Actor "${by}" uses an unknown prefix; expected human:<id>, process:<id>, or <producer>/<version>`);
|
|
57
58
|
});
|
|
@@ -164,6 +165,7 @@ const LINT_RULES = [
|
|
|
164
165
|
fieldValueUnknown,
|
|
165
166
|
requireVerifiedUnmet,
|
|
166
167
|
statusMissing,
|
|
168
|
+
generatedMissing,
|
|
167
169
|
actorPrefixUnknown,
|
|
168
170
|
footnoteSourceUnknown,
|
|
169
171
|
footnoteUndefined,
|
|
@@ -173,4 +175,4 @@ const LINT_RULES = [
|
|
|
173
175
|
];
|
|
174
176
|
|
|
175
177
|
//#endregion
|
|
176
|
-
export { LINT_RULES, actorPrefixUnknown, brokenLinks, configUnknownKey, fieldValueUnknown, footnoteSourceUnknown, footnoteUndefined, missingIndex, requireVerifiedUnmet, requiredKeyMissing, stale, statusMissing, unknownType };
|
|
178
|
+
export { LINT_RULES, actorPrefixUnknown, brokenLinks, configUnknownKey, fieldValueUnknown, footnoteSourceUnknown, footnoteUndefined, generatedMissing, missingIndex, requireVerifiedUnmet, requiredKeyMissing, stale, statusMissing, unknownType };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@okfit/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Spec-level Open Knowledge Format (OKF) v0.2 schemas, bundle loading, graph, derivation, and validation for Effect.",
|
|
6
6
|
"keywords": [
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
"@effected/glob": "^0.6.0",
|
|
42
42
|
"@effected/jsonc": "^0.11.0",
|
|
43
43
|
"@effected/markdown": "^0.10.0",
|
|
44
|
+
"@effected/schemastore": "^0.13.0",
|
|
44
45
|
"@effected/toml": "^0.7.0",
|
|
45
46
|
"@effected/walker": "^0.9.0",
|
|
46
47
|
"@effected/yaml": "^0.15.0",
|