@karmaniverous/jeeves-meta 0.15.7 → 0.15.9
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/README.md +5 -5
- package/dist/cli/jeeves-meta/index.js +465 -254
- package/dist/discovery/getAncestorMeta.d.ts +16 -0
- package/dist/discovery/index.d.ts +1 -0
- package/dist/index.js +462 -239
- package/dist/interfaces/MetaContext.d.ts +2 -0
- package/dist/phaseState/derivePhaseState.d.ts +0 -2
- package/dist/phaseState/index.d.ts +2 -2
- package/dist/phaseState/invalidate.d.ts +5 -7
- package/dist/phaseState/phaseScheduler.d.ts +5 -0
- package/dist/phaseState/phaseTransitions.d.ts +1 -1
- package/dist/routes/metasUpdate.d.ts +1 -1
- package/dist/routes/status.d.ts +1 -1
- package/dist/rules/index.d.ts +1 -3
- package/dist/scheduler/index.d.ts +5 -0
- package/dist/schema/config.d.ts +9 -0
- package/dist/schema/meta.d.ts +4 -0
- package/dist/seed/createMeta.d.ts +6 -0
- package/package.json +58 -58
|
@@ -14,8 +14,6 @@ export interface DerivationInputs {
|
|
|
14
14
|
structureChanged: boolean;
|
|
15
15
|
/** Whether _steer changed vs. latest archive. */
|
|
16
16
|
steerChanged: boolean;
|
|
17
|
-
/** Whether _architect prompt changed. */
|
|
18
|
-
architectChanged: boolean;
|
|
19
17
|
/** Whether _crossRefs declaration changed. */
|
|
20
18
|
crossRefsChanged: boolean;
|
|
21
19
|
/** architectEvery config value. */
|
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
* @module phaseState
|
|
5
5
|
*/
|
|
6
6
|
export { type DerivationInputs, derivePhaseState } from './derivePhaseState.js';
|
|
7
|
-
export { type ArchitectInvalidator, computeInvalidation, type
|
|
8
|
-
export { buildPhaseCandidates, type PhaseCandidate, type PhaseCandidateInput, rankPhaseCandidates, selectPhaseCandidate, selectTier2Candidate, type Tier2Candidate, } from './phaseScheduler.js';
|
|
7
|
+
export { type ArchitectInvalidator, computeInvalidation, type InputStatus, type InvalidationResult, } from './invalidate.js';
|
|
8
|
+
export { buildPhaseCandidates, type PhaseCandidate, type PhaseCandidateInput, rankPhaseCandidates, selectAllTier2Candidates, selectPhaseCandidate, selectTier2Candidate, type Tier2Candidate, } from './phaseScheduler.js';
|
|
9
9
|
export { architectSuccess, builderSuccess, criticSuccess, enforceInvariant, freshPhaseState, getOwedPhase, getPriorityBand, initialPhaseState, invalidateArchitect, invalidateBuilder, isFullyFresh, phaseFailed, phaseRunning, retryAllFailed, retryPhase, } from './phaseTransitions.js';
|
|
@@ -9,23 +9,21 @@
|
|
|
9
9
|
import type { MetaNode } from '../discovery/types.js';
|
|
10
10
|
import type { MetaConfig, MetaJson, PhaseState } from '../schema/index.js';
|
|
11
11
|
/** Architect-level invalidation reasons. */
|
|
12
|
-
export type ArchitectInvalidator = 'structureHash' | 'steer' | '
|
|
13
|
-
/**
|
|
14
|
-
export interface
|
|
12
|
+
export type ArchitectInvalidator = 'structureHash' | 'steer' | '_crossRefs' | 'firstRun' | 'architectEvery';
|
|
13
|
+
/** Informational input status for a meta (exposed in /preview). */
|
|
14
|
+
export interface InputStatus {
|
|
15
15
|
structureHash: string;
|
|
16
16
|
steerChanged: boolean;
|
|
17
17
|
architectChanged: boolean;
|
|
18
|
+
criticChanged: boolean;
|
|
18
19
|
crossRefsDeclChanged: boolean;
|
|
19
|
-
scopeMtimeMax: string | null;
|
|
20
20
|
crossRefContentChanged: boolean;
|
|
21
21
|
}
|
|
22
22
|
/** Result of computing invalidation for a single meta. */
|
|
23
23
|
export interface InvalidationResult {
|
|
24
24
|
phaseState: PhaseState;
|
|
25
25
|
architectInvalidators: ArchitectInvalidator[];
|
|
26
|
-
|
|
27
|
-
structureHash: string;
|
|
28
|
-
steerChanged: boolean;
|
|
26
|
+
inputStatus: InputStatus;
|
|
29
27
|
}
|
|
30
28
|
/**
|
|
31
29
|
* Compute invalidation inputs and apply cascade for a single meta.
|
|
@@ -69,3 +69,8 @@ export interface Tier2Candidate {
|
|
|
69
69
|
* @returns The stalest all-fresh candidate, or null if none exist.
|
|
70
70
|
*/
|
|
71
71
|
export declare function selectTier2Candidate(metas: PhaseCandidateInput[]): Tier2Candidate | null;
|
|
72
|
+
/**
|
|
73
|
+
* Select all fully-fresh, non-disabled, non-locked metas sorted by staleness
|
|
74
|
+
* (descending — stalest first) for Tier 2 invalidation scanning.
|
|
75
|
+
*/
|
|
76
|
+
export declare function selectAllTier2Candidates(metas: PhaseCandidateInput[]): Tier2Candidate[];
|
|
@@ -24,7 +24,7 @@ export declare function initialPhaseState(): PhaseState;
|
|
|
24
24
|
export declare function enforceInvariant(state: PhaseState): PhaseState;
|
|
25
25
|
/**
|
|
26
26
|
* Architect invalidated: architect → pending; builder, critic → stale.
|
|
27
|
-
* Triggers:
|
|
27
|
+
* Triggers: first run, _structureHash change, _steer change,
|
|
28
28
|
* _crossRefs declaration change, _synthesisCount \>= architectEvery.
|
|
29
29
|
*/
|
|
30
30
|
export declare function invalidateArchitect(state: PhaseState): PhaseState;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* PATCH /metas/:path — update user-settable reserved properties on a meta.
|
|
3
3
|
*
|
|
4
|
-
* Supported fields: _steer, _emphasis, _depth, _crossRefs, _disabled.
|
|
4
|
+
* Supported fields: _steer, _emphasis, _depth, _crossRefs, _disabled, _architectTimeout, _builderTimeout, _criticTimeout.
|
|
5
5
|
* Set a field to null to remove it. Unknown keys are rejected.
|
|
6
6
|
*
|
|
7
7
|
* @module routes/metasUpdate
|
package/dist/routes/status.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @module routes/status
|
|
8
8
|
*/
|
|
9
|
-
import type
|
|
9
|
+
import { type ServiceState } from '@karmaniverous/jeeves-meta-core';
|
|
10
10
|
import type { FastifyInstance } from 'fastify';
|
|
11
11
|
import type { RouteDeps } from './index.js';
|
|
12
12
|
export type { ServiceState };
|
package/dist/rules/index.d.ts
CHANGED
|
@@ -21,10 +21,8 @@ export declare class RuleRegistrar {
|
|
|
21
21
|
private readonly logger;
|
|
22
22
|
private readonly watcherClient;
|
|
23
23
|
private lastWatcherUptime;
|
|
24
|
-
private
|
|
24
|
+
private registering;
|
|
25
25
|
constructor(config: MetaConfig, logger: Logger, watcher: WatcherClient);
|
|
26
|
-
/** Whether rules have been successfully registered. */
|
|
27
|
-
get isRegistered(): boolean;
|
|
28
26
|
/**
|
|
29
27
|
* Register rules with watcher. Retries with exponential backoff.
|
|
30
28
|
* Non-blocking — logs errors but never throws.
|
|
@@ -63,4 +63,9 @@ export declare class Scheduler {
|
|
|
63
63
|
* with weighted staleness as tiebreaker within a band.
|
|
64
64
|
*/
|
|
65
65
|
private discoverNextPhase;
|
|
66
|
+
/**
|
|
67
|
+
* Tier 2 invalidation: iterate all-fresh candidates (stalest first),
|
|
68
|
+
* run computeInvalidation, and return the first that produces an owed phase.
|
|
69
|
+
*/
|
|
70
|
+
private discoverTier2Phase;
|
|
66
71
|
}
|
package/dist/schema/config.d.ts
CHANGED
|
@@ -13,6 +13,10 @@ declare const autoSeedRuleSchema: z.ZodObject<{
|
|
|
13
13
|
match: z.ZodString;
|
|
14
14
|
steer: z.ZodOptional<z.ZodString>;
|
|
15
15
|
crossRefs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
16
|
+
parentDepth: z.ZodOptional<z.ZodNumber>;
|
|
17
|
+
architectTimeout: z.ZodOptional<z.ZodNumber>;
|
|
18
|
+
builderTimeout: z.ZodOptional<z.ZodNumber>;
|
|
19
|
+
criticTimeout: z.ZodOptional<z.ZodNumber>;
|
|
16
20
|
}, z.core.$strip>;
|
|
17
21
|
/** Inferred type for an auto-seed rule. */
|
|
18
22
|
export type AutoSeedRule = z.infer<typeof autoSeedRuleSchema>;
|
|
@@ -44,10 +48,15 @@ export declare const serviceConfigSchema: z.ZodObject<{
|
|
|
44
48
|
level: z.ZodDefault<z.ZodString>;
|
|
45
49
|
file: z.ZodOptional<z.ZodString>;
|
|
46
50
|
}, z.core.$strip>>;
|
|
51
|
+
tier2ScanLimit: z.ZodDefault<z.ZodNumber>;
|
|
47
52
|
autoSeed: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
48
53
|
match: z.ZodString;
|
|
49
54
|
steer: z.ZodOptional<z.ZodString>;
|
|
50
55
|
crossRefs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
56
|
+
parentDepth: z.ZodOptional<z.ZodNumber>;
|
|
57
|
+
architectTimeout: z.ZodOptional<z.ZodNumber>;
|
|
58
|
+
builderTimeout: z.ZodOptional<z.ZodNumber>;
|
|
59
|
+
criticTimeout: z.ZodOptional<z.ZodNumber>;
|
|
51
60
|
}, z.core.$strip>>>>;
|
|
52
61
|
}, z.core.$strip>;
|
|
53
62
|
/** Inferred type for service configuration. */
|
package/dist/schema/meta.d.ts
CHANGED
|
@@ -43,6 +43,10 @@ export declare const metaJsonSchema: z.ZodObject<{
|
|
|
43
43
|
message: z.ZodString;
|
|
44
44
|
}, z.core.$strip>>;
|
|
45
45
|
_disabled: z.ZodOptional<z.ZodBoolean>;
|
|
46
|
+
_architectTimeout: z.ZodOptional<z.ZodNumber>;
|
|
47
|
+
_builderTimeout: z.ZodOptional<z.ZodNumber>;
|
|
48
|
+
_criticTimeout: z.ZodOptional<z.ZodNumber>;
|
|
49
|
+
_ancestorBuilderHash: z.ZodOptional<z.ZodString>;
|
|
46
50
|
_phaseState: z.ZodOptional<z.ZodObject<{
|
|
47
51
|
architect: z.ZodEnum<{
|
|
48
52
|
fresh: "fresh";
|
|
@@ -11,6 +11,12 @@ export interface CreateMetaOptions {
|
|
|
11
11
|
crossRefs?: string[];
|
|
12
12
|
/** Steering prompt for the meta. */
|
|
13
13
|
steer?: string;
|
|
14
|
+
/** Per-entity timeout override for the architect phase (seconds). */
|
|
15
|
+
architectTimeout?: number;
|
|
16
|
+
/** Per-entity timeout override for the builder phase (seconds). */
|
|
17
|
+
builderTimeout?: number;
|
|
18
|
+
/** Per-entity timeout override for the critic phase (seconds). */
|
|
19
|
+
criticTimeout?: number;
|
|
14
20
|
}
|
|
15
21
|
/** Result of creating a new meta. */
|
|
16
22
|
export interface CreateMetaResult {
|
package/package.json
CHANGED
|
@@ -1,48 +1,14 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "@karmaniverous/jeeves-meta",
|
|
3
|
-
"version": "0.15.7",
|
|
4
2
|
"author": "Jason Williscroft",
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
"type": "module",
|
|
8
|
-
"module": "dist/index.js",
|
|
9
|
-
"types": "dist/index.d.ts",
|
|
10
|
-
"exports": {
|
|
11
|
-
".": {
|
|
12
|
-
"types": "./dist/index.d.ts",
|
|
13
|
-
"default": "./dist/index.js"
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
"files": [
|
|
17
|
-
"dist"
|
|
18
|
-
],
|
|
19
|
-
"publishConfig": {
|
|
20
|
-
"access": "public"
|
|
21
|
-
},
|
|
22
|
-
"repository": {
|
|
23
|
-
"type": "git",
|
|
24
|
-
"url": "git+https://github.com/karmaniverous/jeeves-meta.git",
|
|
25
|
-
"directory": "packages/service"
|
|
3
|
+
"bin": {
|
|
4
|
+
"jeeves-meta": "./dist/cli/jeeves-meta/index.js"
|
|
26
5
|
},
|
|
27
6
|
"bugs": {
|
|
28
7
|
"url": "https://github.com/karmaniverous/jeeves-meta/issues"
|
|
29
8
|
},
|
|
30
|
-
"homepage": "https://github.com/karmaniverous/jeeves-meta#readme",
|
|
31
|
-
"keywords": [
|
|
32
|
-
"synthesis",
|
|
33
|
-
"knowledge",
|
|
34
|
-
"meta",
|
|
35
|
-
"jeeves",
|
|
36
|
-
"service",
|
|
37
|
-
"fastify",
|
|
38
|
-
"typescript"
|
|
39
|
-
],
|
|
40
|
-
"engines": {
|
|
41
|
-
"node": ">=22"
|
|
42
|
-
},
|
|
43
9
|
"dependencies": {
|
|
44
|
-
"@karmaniverous/jeeves": "^0.5.
|
|
45
|
-
"@karmaniverous/jeeves-meta-core": "^0.1.
|
|
10
|
+
"@karmaniverous/jeeves": "^0.5.11",
|
|
11
|
+
"@karmaniverous/jeeves-meta-core": "^0.1.3",
|
|
46
12
|
"commander": "^14",
|
|
47
13
|
"croner": "^10",
|
|
48
14
|
"fastify": "^5.8",
|
|
@@ -51,41 +17,56 @@
|
|
|
51
17
|
"pino": "^10",
|
|
52
18
|
"zod": "^4.4"
|
|
53
19
|
},
|
|
20
|
+
"description": "Fastify HTTP service for the Jeeves Meta synthesis engine",
|
|
54
21
|
"devDependencies": {
|
|
55
|
-
"@dotenvx/dotenvx": "^1.
|
|
22
|
+
"@dotenvx/dotenvx": "^1.69.1",
|
|
56
23
|
"@rollup/plugin-commonjs": "^29.0.2",
|
|
57
24
|
"@rollup/plugin-json": "^6.1.0",
|
|
58
25
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
59
26
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
60
|
-
"@types/node": "^25.
|
|
61
|
-
"@vitest/coverage-v8": "^4.1.
|
|
27
|
+
"@types/node": "^25.9.1",
|
|
28
|
+
"@vitest/coverage-v8": "^4.1.7",
|
|
62
29
|
"cross-env": "^10.1.0",
|
|
63
30
|
"release-it": "^20.0.1",
|
|
64
|
-
"rollup": "^4.60.
|
|
31
|
+
"rollup": "^4.60.4",
|
|
65
32
|
"rollup-plugin-copy": "^3.5.0",
|
|
66
33
|
"tslib": "^2.8.1",
|
|
67
|
-
"vitest": "^4.1.
|
|
34
|
+
"vitest": "^4.1.7"
|
|
68
35
|
},
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"knip": "knip",
|
|
72
|
-
"lint": "eslint .",
|
|
73
|
-
"lint:fix": "eslint --fix .",
|
|
74
|
-
"test": "vitest run",
|
|
75
|
-
"typecheck": "tsc",
|
|
76
|
-
"changelog": "git-cliff -o CHANGELOG.md",
|
|
77
|
-
"release": "dotenvx run -f .env.local -- release-it",
|
|
78
|
-
"release:pre": "dotenvx run -f .env.local -- release-it --no-git.requireBranch --github.prerelease --preRelease"
|
|
36
|
+
"engines": {
|
|
37
|
+
"node": ">=22"
|
|
79
38
|
},
|
|
80
|
-
"
|
|
81
|
-
"
|
|
39
|
+
"exports": {
|
|
40
|
+
".": {
|
|
41
|
+
"types": "./dist/index.d.ts",
|
|
42
|
+
"default": "./dist/index.js"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"files": [
|
|
46
|
+
"dist"
|
|
47
|
+
],
|
|
48
|
+
"homepage": "https://github.com/karmaniverous/jeeves-meta#readme",
|
|
49
|
+
"keywords": [
|
|
50
|
+
"synthesis",
|
|
51
|
+
"knowledge",
|
|
52
|
+
"meta",
|
|
53
|
+
"jeeves",
|
|
54
|
+
"service",
|
|
55
|
+
"fastify",
|
|
56
|
+
"typescript"
|
|
57
|
+
],
|
|
58
|
+
"license": "BSD-3-Clause",
|
|
59
|
+
"module": "dist/index.js",
|
|
60
|
+
"name": "@karmaniverous/jeeves-meta",
|
|
61
|
+
"publishConfig": {
|
|
62
|
+
"access": "public"
|
|
82
63
|
},
|
|
83
64
|
"release-it": {
|
|
84
65
|
"git": {
|
|
85
66
|
"changelog": "npx git-cliff --unreleased --strip header",
|
|
86
67
|
"commitMessage": "chore: release @karmaniverous/jeeves-meta v${version}",
|
|
87
|
-
"
|
|
88
|
-
"
|
|
68
|
+
"requireBranch": "main",
|
|
69
|
+
"tagName": "service/${version}"
|
|
89
70
|
},
|
|
90
71
|
"github": {
|
|
91
72
|
"release": true
|
|
@@ -110,5 +91,24 @@
|
|
|
110
91
|
"npm": {
|
|
111
92
|
"publish": true
|
|
112
93
|
}
|
|
113
|
-
}
|
|
94
|
+
},
|
|
95
|
+
"repository": {
|
|
96
|
+
"directory": "packages/service",
|
|
97
|
+
"type": "git",
|
|
98
|
+
"url": "git+https://github.com/karmaniverous/jeeves-meta.git"
|
|
99
|
+
},
|
|
100
|
+
"scripts": {
|
|
101
|
+
"build": "rimraf dist && cross-env NO_COLOR=1 rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript",
|
|
102
|
+
"changelog": "git-cliff -o CHANGELOG.md",
|
|
103
|
+
"knip": "knip",
|
|
104
|
+
"lint": "eslint .",
|
|
105
|
+
"lint:fix": "eslint --fix .",
|
|
106
|
+
"release": "dotenvx run -f .env.local -- release-it",
|
|
107
|
+
"release:pre": "dotenvx run -f .env.local -- release-it --no-git.requireBranch --github.prerelease --preRelease",
|
|
108
|
+
"test": "vitest run",
|
|
109
|
+
"typecheck": "tsc"
|
|
110
|
+
},
|
|
111
|
+
"type": "module",
|
|
112
|
+
"types": "dist/index.d.ts",
|
|
113
|
+
"version": "0.15.9"
|
|
114
114
|
}
|