@karmaniverous/jeeves-meta 0.15.3 → 0.15.5

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.
Files changed (89) hide show
  1. package/dist/archive/index.d.ts +10 -0
  2. package/dist/archive/listArchive.d.ts +12 -0
  3. package/dist/archive/prune.d.ts +14 -0
  4. package/dist/archive/readArchive.d.ts +30 -0
  5. package/dist/archive/readLatest.d.ts +13 -0
  6. package/dist/archive/snapshot.d.ts +17 -0
  7. package/dist/bootstrap.d.ts +15 -0
  8. package/dist/cache.d.ts +22 -0
  9. package/dist/cli/jeeves-meta/architect.md +17 -0
  10. package/dist/cli/jeeves-meta/index.js +811 -734
  11. package/dist/cli.d.ts +10 -0
  12. package/dist/configHotReload.d.ts +30 -0
  13. package/dist/configLoader.d.ts +37 -0
  14. package/dist/constants.d.ts +13 -0
  15. package/dist/customCliCommands.d.ts +13 -0
  16. package/dist/descriptor.d.ts +19 -0
  17. package/dist/discovery/buildMinimalNode.d.ts +22 -0
  18. package/dist/discovery/computeSummary.d.ts +17 -0
  19. package/dist/discovery/discoverMetas.d.ts +19 -0
  20. package/dist/discovery/index.d.ts +11 -0
  21. package/dist/discovery/listMetas.d.ts +63 -0
  22. package/dist/discovery/ownershipTree.d.ts +25 -0
  23. package/dist/discovery/scope.d.ts +47 -0
  24. package/dist/discovery/types.d.ts +25 -0
  25. package/dist/ema.d.ts +14 -0
  26. package/dist/errors.d.ts +15 -0
  27. package/dist/escapeGlob.d.ts +23 -0
  28. package/dist/executor/GatewayExecutor.d.ts +48 -0
  29. package/dist/executor/SpawnAbortedError.d.ts +9 -0
  30. package/dist/executor/SpawnTimeoutError.d.ts +13 -0
  31. package/dist/executor/index.d.ts +8 -0
  32. package/dist/index.d.ts +34 -1660
  33. package/dist/index.js +1434 -1767
  34. package/dist/interfaces/MetaContext.d.ts +36 -0
  35. package/dist/interfaces/MetaExecutor.d.ts +46 -0
  36. package/dist/interfaces/WatcherClient.d.ts +75 -0
  37. package/dist/interfaces/index.d.ts +8 -0
  38. package/dist/lock.d.ts +70 -0
  39. package/dist/logger/index.d.ts +27 -0
  40. package/dist/mtimeFilter.d.ts +26 -0
  41. package/dist/normalizePath.d.ts +6 -0
  42. package/dist/orchestrator/buildTask.d.ts +38 -0
  43. package/dist/orchestrator/contextPackage.d.ts +30 -0
  44. package/dist/orchestrator/index.d.ts +10 -0
  45. package/dist/orchestrator/orchestratePhase.d.ts +38 -0
  46. package/dist/orchestrator/parseOutput.d.ts +41 -0
  47. package/dist/orchestrator/runPhase.d.ts +40 -0
  48. package/dist/phaseState/derivePhaseState.d.ts +41 -0
  49. package/dist/phaseState/index.d.ts +9 -0
  50. package/dist/phaseState/invalidate.d.ts +41 -0
  51. package/dist/phaseState/phaseScheduler.d.ts +57 -0
  52. package/dist/phaseState/phaseTransitions.d.ts +83 -0
  53. package/dist/progress/index.d.ts +38 -0
  54. package/dist/prompts/architect.md +17 -0
  55. package/dist/prompts/index.d.ts +15 -0
  56. package/dist/queue/index.d.ts +131 -0
  57. package/dist/readMetaJson.d.ts +17 -0
  58. package/dist/routes/__testUtils.d.ts +37 -0
  59. package/dist/routes/config.d.ts +11 -0
  60. package/dist/routes/configApply.d.ts +13 -0
  61. package/dist/routes/index.d.ts +50 -0
  62. package/dist/routes/metas.d.ts +9 -0
  63. package/dist/routes/metasUpdate.d.ts +11 -0
  64. package/dist/routes/preview.d.ts +8 -0
  65. package/dist/routes/queue.d.ts +13 -0
  66. package/dist/routes/seed.d.ts +8 -0
  67. package/dist/routes/status.d.ts +13 -0
  68. package/dist/routes/synthesize.d.ts +12 -0
  69. package/dist/routes/unlock.d.ts +8 -0
  70. package/dist/rules/healthCheck.d.ts +36 -0
  71. package/dist/rules/index.d.ts +39 -0
  72. package/dist/rules/verify.d.ts +22 -0
  73. package/dist/scheduler/index.d.ts +66 -0
  74. package/dist/scheduling/index.d.ts +7 -0
  75. package/dist/scheduling/staleness.d.ts +68 -0
  76. package/dist/scheduling/weightedFormula.d.ts +38 -0
  77. package/dist/schema/config.d.ts +54 -0
  78. package/dist/schema/error.d.ts +6 -0
  79. package/dist/schema/index.d.ts +8 -0
  80. package/dist/schema/meta.d.ts +71 -0
  81. package/dist/seed/autoSeed.d.ts +30 -0
  82. package/dist/seed/createMeta.d.ts +38 -0
  83. package/dist/seed/index.d.ts +7 -0
  84. package/dist/server.d.ts +24 -0
  85. package/dist/shutdown/index.d.ts +33 -0
  86. package/dist/structureHash.d.ts +15 -0
  87. package/dist/watcher-client/HttpWatcherClient.d.ts +38 -0
  88. package/dist/watcher-client/index.d.ts +6 -0
  89. package/package.json +17 -27
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Archive module — snapshot creation, pruning, and reading.
3
+ *
4
+ * @module archive
5
+ */
6
+ export { listArchiveFiles } from './listArchive.js';
7
+ export { pruneArchive } from './prune.js';
8
+ export { readArchiveFromDisk, readArchiveFromWatcher } from './readArchive.js';
9
+ export { readLatestArchive } from './readLatest.js';
10
+ export { createSnapshot } from './snapshot.js';
@@ -0,0 +1,12 @@
1
+ /**
2
+ * List archive snapshot files in chronological order.
3
+ *
4
+ * @module archive/listArchive
5
+ */
6
+ /**
7
+ * List archive .json files sorted chronologically (oldest first).
8
+ *
9
+ * @param metaPath - Absolute path to the .meta directory.
10
+ * @returns Array of absolute paths to archive files, or empty if none.
11
+ */
12
+ export declare function listArchiveFiles(metaPath: string): string[];
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Prune old archive snapshots beyond maxArchive.
3
+ *
4
+ * @module archive/prune
5
+ */
6
+ /**
7
+ * Prune archive directory to keep at most maxArchive snapshots.
8
+ * Removes the oldest files.
9
+ *
10
+ * @param metaPath - Absolute path to the .meta directory.
11
+ * @param maxArchive - Maximum snapshots to retain.
12
+ * @returns Number of files pruned.
13
+ */
14
+ export declare function pruneArchive(metaPath: string, maxArchive: number): Promise<number>;
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Archive reading helpers — watcher scan with filesystem fallback.
3
+ *
4
+ * Used by the GET /metas/:path route to retrieve archive history.
5
+ * Prefers watcher scan for performance; falls back to disk reads
6
+ * when the watcher is unavailable.
7
+ *
8
+ * @module archive/readArchive
9
+ */
10
+ import type { WatcherClient } from '../interfaces/index.js';
11
+ /**
12
+ * Read archive history via watcher scan.
13
+ *
14
+ * @param watcher - WatcherClient with scan support.
15
+ * @param metaPath - Absolute path to the .meta/ directory.
16
+ * @param metaArchiveProperty - Additional filter properties for archive points.
17
+ * @param limit - Max entries to return (newest first). Undefined = all.
18
+ * @param projectMeta - Field projection function.
19
+ * @returns Array of projected archive entries, newest first.
20
+ */
21
+ export declare function readArchiveFromWatcher(watcher: WatcherClient, metaPath: string, metaArchiveProperty: Record<string, unknown>, limit: number | undefined, projectMeta: (m: Record<string, unknown>) => Record<string, unknown>): Promise<Array<Record<string, unknown>>>;
22
+ /**
23
+ * Read archive history from disk (fallback).
24
+ *
25
+ * @param metaPath - Absolute path to the .meta/ directory.
26
+ * @param limit - Max entries to return (newest first). Undefined = all.
27
+ * @param projectMeta - Field projection function.
28
+ * @returns Array of projected archive entries, newest first.
29
+ */
30
+ export declare function readArchiveFromDisk(metaPath: string, limit: number | undefined, projectMeta: (m: Record<string, unknown>) => Record<string, unknown>): Promise<Array<Record<string, unknown>>>;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Read the latest archive snapshot for steer change detection.
3
+ *
4
+ * @module archive/readLatest
5
+ */
6
+ import type { MetaJson } from '../schema/index.js';
7
+ /**
8
+ * Read the most recent archive snapshot.
9
+ *
10
+ * @param metaPath - Absolute path to the .meta directory.
11
+ * @returns The latest archived meta, or null if no archives exist.
12
+ */
13
+ export declare function readLatestArchive(metaPath: string): Promise<MetaJson | null>;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Create archive snapshots of meta.json.
3
+ *
4
+ * Copies current meta.json to archive/\{ISO-timestamp\}.json with
5
+ * _archived: true and _archivedAt added.
6
+ *
7
+ * @module archive/snapshot
8
+ */
9
+ import type { MetaJson } from '../schema/index.js';
10
+ /**
11
+ * Create an archive snapshot of the current meta.json.
12
+ *
13
+ * @param metaPath - Absolute path to the .meta directory.
14
+ * @param meta - Current meta.json content.
15
+ * @returns The archive file path.
16
+ */
17
+ export declare function createSnapshot(metaPath: string, meta: MetaJson): Promise<string>;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Service bootstrap — wire up all components and start listening.
3
+ *
4
+ * @module bootstrap
5
+ */
6
+ import { type ServiceConfig } from './schema/config.js';
7
+ /**
8
+ * Bootstrap the service: create logger, build server, start listening,
9
+ * wire scheduler, queue processing, rule registration, config hot-reload,
10
+ * startup lock cleanup, and shutdown.
11
+ *
12
+ * @param config - Validated service configuration.
13
+ * @param configPath - Optional path to config file for hot-reload.
14
+ */
15
+ export declare function startService(config: ServiceConfig, configPath?: string): Promise<void>;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * In-memory cache for listMetas results with TTL and concurrent refresh guard.
3
+ *
4
+ * @module cache
5
+ */
6
+ import { type MetaListResult } from './discovery/index.js';
7
+ import type { WatcherClient } from './interfaces/index.js';
8
+ import type { ServiceConfig } from './schema/config.js';
9
+ /**
10
+ * Caches listMetas results to avoid expensive repeated filesystem walks.
11
+ * Supports concurrent refresh coalescing and manual invalidation.
12
+ */
13
+ export declare class MetaCache {
14
+ private result;
15
+ private updatedAt;
16
+ private refreshPromise;
17
+ /** Get cached result or refresh if stale. */
18
+ get(config: ServiceConfig, watcher: WatcherClient): Promise<MetaListResult>;
19
+ /** Force-expire the cache so next get() triggers a refresh. */
20
+ invalidate(): void;
21
+ private refresh;
22
+ }
@@ -91,6 +91,23 @@ Define what "verify before asserting" means for this data shape:
91
91
  Always require: exact entity titles/names (not paraphrases), evidence citations,
92
92
  partial implementation notes, config default verification from schema files.
93
93
 
94
+ {{#if (gt scope.fileCount 500)}}
95
+ ## LARGE SCOPE — SAMPLING MODE
96
+
97
+ This entity has {{scope.fileCount}} files. Do NOT attempt to read or
98
+ explore the full scope. Instead:
99
+
100
+ 1. Read _state and _content from previous cycles to understand existing
101
+ data shape knowledge
102
+ 2. Sample at most 5–10 representative files to verify the data shape
103
+ hasn't fundamentally changed
104
+ 3. Focus your brief updates on what the _feedback says needs improving
105
+ 4. Preserve the existing progressive processing strategy unless the
106
+ data shape has materially changed
107
+
108
+ Your job on re-runs is refinement, not rediscovery.
109
+ {{/if}}
110
+
94
111
  ### 7. Progressive Processing (_state)
95
112
 
96
113
  When the scope is large (hundreds of files or more), instruct the Builder to