@telora/daemon 0.20.19 → 0.20.28

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 (107) hide show
  1. package/build-info.json +4 -3
  2. package/dist/audit-phase.d.ts +43 -6
  3. package/dist/audit-phase.d.ts.map +1 -1
  4. package/dist/audit-phase.js +124 -23
  5. package/dist/audit-phase.js.map +1 -1
  6. package/dist/cascade-restatement.d.ts +13 -147
  7. package/dist/cascade-restatement.d.ts.map +1 -1
  8. package/dist/cascade-restatement.js +13 -429
  9. package/dist/cascade-restatement.js.map +1 -1
  10. package/dist/cli/session-state.d.ts.map +1 -1
  11. package/dist/cli/session-state.js +6 -1
  12. package/dist/cli/session-state.js.map +1 -1
  13. package/dist/focus-engine.d.ts.map +1 -1
  14. package/dist/focus-engine.js +15 -0
  15. package/dist/focus-engine.js.map +1 -1
  16. package/dist/focus-loop-registry.d.ts.map +1 -1
  17. package/dist/focus-loop-registry.js +16 -90
  18. package/dist/focus-loop-registry.js.map +1 -1
  19. package/dist/focus-loop.d.ts +0 -2
  20. package/dist/focus-loop.d.ts.map +1 -1
  21. package/dist/focus-loop.js +33 -25
  22. package/dist/focus-loop.js.map +1 -1
  23. package/dist/focus-phase.d.ts +26 -0
  24. package/dist/focus-phase.d.ts.map +1 -1
  25. package/dist/focus-phase.js +38 -0
  26. package/dist/focus-phase.js.map +1 -1
  27. package/dist/listener.d.ts.map +1 -1
  28. package/dist/listener.js +40 -9
  29. package/dist/listener.js.map +1 -1
  30. package/dist/loops/llm-client.d.ts.map +1 -1
  31. package/dist/loops/llm-client.js +17 -4
  32. package/dist/loops/llm-client.js.map +1 -1
  33. package/dist/queries/audit-runs.d.ts +56 -2
  34. package/dist/queries/audit-runs.d.ts.map +1 -1
  35. package/dist/queries/audit-runs.js +40 -0
  36. package/dist/queries/audit-runs.js.map +1 -1
  37. package/dist/queries/deliveries.d.ts +27 -0
  38. package/dist/queries/deliveries.d.ts.map +1 -1
  39. package/dist/queries/deliveries.js.map +1 -1
  40. package/dist/queries/focuses.d.ts +0 -9
  41. package/dist/queries/focuses.d.ts.map +1 -1
  42. package/dist/queries/focuses.js +0 -14
  43. package/dist/queries/focuses.js.map +1 -1
  44. package/dist/resolvers/index.d.ts +1 -1
  45. package/dist/resolvers/index.d.ts.map +1 -1
  46. package/dist/resolvers/index.js +1 -1
  47. package/dist/resolvers/index.js.map +1 -1
  48. package/dist/resolvers/shared/audit.d.ts +5 -0
  49. package/dist/resolvers/shared/audit.d.ts.map +1 -1
  50. package/dist/resolvers/shared/audit.js +8 -3
  51. package/dist/resolvers/shared/audit.js.map +1 -1
  52. package/dist/resolvers/shared/git-diff.d.ts +13 -0
  53. package/dist/resolvers/shared/git-diff.d.ts.map +1 -1
  54. package/dist/resolvers/shared/git-diff.js +30 -0
  55. package/dist/resolvers/shared/git-diff.js.map +1 -1
  56. package/dist/spawn/review-role-fallback.d.ts +74 -0
  57. package/dist/spawn/review-role-fallback.d.ts.map +1 -0
  58. package/dist/spawn/review-role-fallback.js +62 -0
  59. package/dist/spawn/review-role-fallback.js.map +1 -0
  60. package/dist/unified-shell-status.d.ts.map +1 -1
  61. package/dist/unified-shell-status.js +5 -1
  62. package/dist/unified-shell-status.js.map +1 -1
  63. package/dist/verification-config.d.ts +64 -15
  64. package/dist/verification-config.d.ts.map +1 -1
  65. package/dist/verification-config.js +66 -21
  66. package/dist/verification-config.js.map +1 -1
  67. package/dist/verification-default-on.d.ts +73 -1
  68. package/dist/verification-default-on.d.ts.map +1 -1
  69. package/dist/verification-default-on.js +79 -0
  70. package/dist/verification-default-on.js.map +1 -1
  71. package/dist/verification-engine.d.ts +16 -2
  72. package/dist/verification-engine.d.ts.map +1 -1
  73. package/dist/verification-engine.js +168 -84
  74. package/dist/verification-engine.js.map +1 -1
  75. package/dist/verification-feedback.d.ts +26 -1
  76. package/dist/verification-feedback.d.ts.map +1 -1
  77. package/dist/verification-feedback.js +82 -0
  78. package/dist/verification-feedback.js.map +1 -1
  79. package/dist/verification-manifest.d.ts +110 -0
  80. package/dist/verification-manifest.d.ts.map +1 -0
  81. package/dist/verification-manifest.js +150 -0
  82. package/dist/verification-manifest.js.map +1 -0
  83. package/dist/verify-reconciliation.d.ts +16 -1
  84. package/dist/verify-reconciliation.d.ts.map +1 -1
  85. package/dist/verify-reconciliation.js +18 -2
  86. package/dist/verify-reconciliation.js.map +1 -1
  87. package/dist/verify-restatement.d.ts +7 -0
  88. package/dist/verify-restatement.d.ts.map +1 -1
  89. package/dist/verify-restatement.js +1 -0
  90. package/dist/verify-restatement.js.map +1 -1
  91. package/package.json +2 -2
  92. package/dist/drift-ratify-loop.d.ts +0 -68
  93. package/dist/drift-ratify-loop.d.ts.map +0 -1
  94. package/dist/drift-ratify-loop.js +0 -161
  95. package/dist/drift-ratify-loop.js.map +0 -1
  96. package/dist/negative-branch.d.ts +0 -136
  97. package/dist/negative-branch.d.ts.map +0 -1
  98. package/dist/negative-branch.js +0 -241
  99. package/dist/negative-branch.js.map +0 -1
  100. package/dist/shortfall-disposition-config.d.ts +0 -34
  101. package/dist/shortfall-disposition-config.d.ts.map +0 -1
  102. package/dist/shortfall-disposition-config.js +0 -46
  103. package/dist/shortfall-disposition-config.js.map +0 -1
  104. package/dist/shortfall-disposition-loop.d.ts +0 -86
  105. package/dist/shortfall-disposition-loop.d.ts.map +0 -1
  106. package/dist/shortfall-disposition-loop.js +0 -309
  107. package/dist/shortfall-disposition-loop.js.map +0 -1
@@ -0,0 +1,110 @@
1
+ /**
2
+ * Repo-committed verification manifest (`telora.verify.json` at the repo root).
3
+ *
4
+ * WHY a repo-committed layer exists
5
+ * ---------------------------------
6
+ * The daemon's deterministic verify gate was fully built but structurally
7
+ * UNARMABLE from the repo. Before this module, the only two ways to supply a
8
+ * verification command were:
9
+ *
10
+ * 1. the env var `TELORA_DEFAULT_VERIFY_COMMAND`, and
11
+ * 2. the operator's per-workstation config file, which
12
+ * `cli/verify-setup.ts:218` resolves to
13
+ * `resolve(homedir(), '.telora', 'daemon.json')` -- a HOME-dir path that
14
+ * is not in any repo, and
15
+ * `.gitignore:72` ignores `.telora/` WHOLESALE, so a repo-local
16
+ * `.telora/daemon.json` could not be committed either.
17
+ *
18
+ * Both layers are per-workstation and untracked. The consequence: no agent and
19
+ * no PR could arm the gate, and a fresh clone was ungated by construction. A
20
+ * focus whose thesis is "gate at the source" could not put the gate's
21
+ * definition IN the source.
22
+ *
23
+ * This module adds the missing layer: a TRACKED, repo-root file by which a repo
24
+ * DECLARES ITS OWN gate command, so the declaration travels with the code it
25
+ * gates. It sits BELOW the operator file and ABOVE '' (disabled) in
26
+ * `resolveDefaultVerification` (verification-config.ts).
27
+ *
28
+ * Path choice: git cannot re-include a file whose parent directory is
29
+ * excluded, so a `.telora/`-nested manifest is unreachable without unignoring
30
+ * the whole directory. Hence a repo-ROOT filename, deliberately outside
31
+ * `.telora/`.
32
+ *
33
+ * WHY malformed FAILS LOUDLY (missing does not)
34
+ * ---------------------------------------------
35
+ * The two states are read as different operator statements:
36
+ *
37
+ * - MISSING manifest => `undefined` => the resolver falls through to ''
38
+ * (inert). This PRESERVES THE OPT-IN SEAM: the daemon manages repos that
39
+ * have no whole-repo verification command at all, and they must keep
40
+ * resolving to disabled. A repo that ships no manifest has said nothing.
41
+ * - MALFORMED manifest => THROW, naming the file path and the problem. A repo
42
+ * that ships a manifest HAS said something, and we could not read it.
43
+ * Degrading that to "disabled" would silently un-arm the gate on a typo --
44
+ * a trailing comma, or `"commnad"` for `"command"` -- and the delivery would
45
+ * sail to done on AI review alone while the repo believed it was gated.
46
+ * That silent-disable-on-typo is the EXACT failure class this module exists
47
+ * to remove, so it is never inferred: a broken declaration is louder than
48
+ * no declaration.
49
+ *
50
+ * For the same reason a manifest carrying no usable `command` is malformed, not
51
+ * absent: the file's whole purpose is to declare a command, and a key typo
52
+ * lands exactly there.
53
+ *
54
+ * @module verification-manifest
55
+ */
56
+ /**
57
+ * Filename of the repo-committed manifest, at the REPO ROOT.
58
+ *
59
+ * Deliberately not under `.telora/` -- `.gitignore:72` ignores that directory
60
+ * wholesale and git cannot re-include a file whose parent dir is excluded, so a
61
+ * manifest there could never be tracked. A repo-root name is trivially
62
+ * trackable (`git check-ignore -v telora.verify.json` finds no match).
63
+ */
64
+ export declare const VERIFY_MANIFEST_FILENAME = "telora.verify.json";
65
+ /**
66
+ * The repo's own declaration of its mechanical gate.
67
+ *
68
+ * `command` is required -- declaring the command IS the point of the file.
69
+ * `timeoutMs` / `maxConcurrent` are optional refinements; omitted => the layers
70
+ * above/below supply them (env, operator file, then the typed defaults in
71
+ * verification-config.ts).
72
+ */
73
+ export interface VerifyManifest {
74
+ /** Whole-repo verification command run at the coding->verify edge. */
75
+ command: string;
76
+ /** Optional timeout (ms) for the command. Must be > 0 when present. */
77
+ timeoutMs?: number;
78
+ /** Optional cap on concurrent daemon-side runs. Must be > 0 when present. */
79
+ maxConcurrent?: number;
80
+ }
81
+ /**
82
+ * Injectable file-system seam (existence + read), mirroring how sibling daemon
83
+ * modules take a deps object with a real-fs default. Tests pass fakes; nothing
84
+ * else in the resolver chain has to touch a real repo.
85
+ */
86
+ export interface VerifyManifestFs {
87
+ /** True iff a readable manifest exists at `path`. */
88
+ exists(path: string): boolean;
89
+ /** Read `path` as UTF-8 text. May throw (an unreadable manifest is loud). */
90
+ readText(path: string): string;
91
+ }
92
+ /** Real-fs default for {@link VerifyManifestFs}. */
93
+ export declare const defaultVerifyManifestFs: VerifyManifestFs;
94
+ /** Reader shape, so callers can inject a fake without importing this module's fs. */
95
+ export type VerifyManifestReader = (repoPath: string | undefined, fs?: VerifyManifestFs) => VerifyManifest | undefined;
96
+ /** Absolute path of the manifest for a product's repo. */
97
+ export declare function resolveVerifyManifestPath(repoPath: string): string;
98
+ /**
99
+ * Read the repo's verification manifest.
100
+ *
101
+ * @param repoPath Product repo root (`configForProduct` sets this per product).
102
+ * Undefined => no repo to read => `undefined`.
103
+ * @param fs Injectable fs seam; defaults to real fs.
104
+ * @returns The parsed manifest, or `undefined` when no manifest file exists.
105
+ * @throws Error naming the file path when the manifest exists but is
106
+ * unreadable / not JSON / not an object / carries no usable `command`
107
+ * / carries a non-positive `timeoutMs` or `maxConcurrent`.
108
+ */
109
+ export declare const readVerifyManifest: VerifyManifestReader;
110
+ //# sourceMappingURL=verification-manifest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verification-manifest.d.ts","sourceRoot":"","sources":["../src/verification-manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AAKH;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,uBAAuB,CAAC;AAE7D;;;;;;;GAOG;AACH,MAAM,WAAW,cAAc;IAC7B,sEAAsE;IACtE,OAAO,EAAE,MAAM,CAAC;IAChB,uEAAuE;IACvE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6EAA6E;IAC7E,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,qDAAqD;IACrD,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAC9B,6EAA6E;IAC7E,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;CAChC;AAED,oDAAoD;AACpD,eAAO,MAAM,uBAAuB,EAAE,gBAGrC,CAAC;AAEF,qFAAqF;AACrF,MAAM,MAAM,oBAAoB,GAAG,CACjC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,EAAE,CAAC,EAAE,gBAAgB,KAClB,cAAc,GAAG,SAAS,CAAC;AAEhC,0DAA0D;AAC1D,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAElE;AA+BD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kBAAkB,EAAE,oBAgDhC,CAAC"}
@@ -0,0 +1,150 @@
1
+ /**
2
+ * Repo-committed verification manifest (`telora.verify.json` at the repo root).
3
+ *
4
+ * WHY a repo-committed layer exists
5
+ * ---------------------------------
6
+ * The daemon's deterministic verify gate was fully built but structurally
7
+ * UNARMABLE from the repo. Before this module, the only two ways to supply a
8
+ * verification command were:
9
+ *
10
+ * 1. the env var `TELORA_DEFAULT_VERIFY_COMMAND`, and
11
+ * 2. the operator's per-workstation config file, which
12
+ * `cli/verify-setup.ts:218` resolves to
13
+ * `resolve(homedir(), '.telora', 'daemon.json')` -- a HOME-dir path that
14
+ * is not in any repo, and
15
+ * `.gitignore:72` ignores `.telora/` WHOLESALE, so a repo-local
16
+ * `.telora/daemon.json` could not be committed either.
17
+ *
18
+ * Both layers are per-workstation and untracked. The consequence: no agent and
19
+ * no PR could arm the gate, and a fresh clone was ungated by construction. A
20
+ * focus whose thesis is "gate at the source" could not put the gate's
21
+ * definition IN the source.
22
+ *
23
+ * This module adds the missing layer: a TRACKED, repo-root file by which a repo
24
+ * DECLARES ITS OWN gate command, so the declaration travels with the code it
25
+ * gates. It sits BELOW the operator file and ABOVE '' (disabled) in
26
+ * `resolveDefaultVerification` (verification-config.ts).
27
+ *
28
+ * Path choice: git cannot re-include a file whose parent directory is
29
+ * excluded, so a `.telora/`-nested manifest is unreachable without unignoring
30
+ * the whole directory. Hence a repo-ROOT filename, deliberately outside
31
+ * `.telora/`.
32
+ *
33
+ * WHY malformed FAILS LOUDLY (missing does not)
34
+ * ---------------------------------------------
35
+ * The two states are read as different operator statements:
36
+ *
37
+ * - MISSING manifest => `undefined` => the resolver falls through to ''
38
+ * (inert). This PRESERVES THE OPT-IN SEAM: the daemon manages repos that
39
+ * have no whole-repo verification command at all, and they must keep
40
+ * resolving to disabled. A repo that ships no manifest has said nothing.
41
+ * - MALFORMED manifest => THROW, naming the file path and the problem. A repo
42
+ * that ships a manifest HAS said something, and we could not read it.
43
+ * Degrading that to "disabled" would silently un-arm the gate on a typo --
44
+ * a trailing comma, or `"commnad"` for `"command"` -- and the delivery would
45
+ * sail to done on AI review alone while the repo believed it was gated.
46
+ * That silent-disable-on-typo is the EXACT failure class this module exists
47
+ * to remove, so it is never inferred: a broken declaration is louder than
48
+ * no declaration.
49
+ *
50
+ * For the same reason a manifest carrying no usable `command` is malformed, not
51
+ * absent: the file's whole purpose is to declare a command, and a key typo
52
+ * lands exactly there.
53
+ *
54
+ * @module verification-manifest
55
+ */
56
+ import { existsSync, readFileSync } from 'node:fs';
57
+ import { resolve } from 'node:path';
58
+ /**
59
+ * Filename of the repo-committed manifest, at the REPO ROOT.
60
+ *
61
+ * Deliberately not under `.telora/` -- `.gitignore:72` ignores that directory
62
+ * wholesale and git cannot re-include a file whose parent dir is excluded, so a
63
+ * manifest there could never be tracked. A repo-root name is trivially
64
+ * trackable (`git check-ignore -v telora.verify.json` finds no match).
65
+ */
66
+ export const VERIFY_MANIFEST_FILENAME = 'telora.verify.json';
67
+ /** Real-fs default for {@link VerifyManifestFs}. */
68
+ export const defaultVerifyManifestFs = {
69
+ exists: (path) => existsSync(path),
70
+ readText: (path) => readFileSync(path, 'utf-8'),
71
+ };
72
+ /** Absolute path of the manifest for a product's repo. */
73
+ export function resolveVerifyManifestPath(repoPath) {
74
+ return resolve(repoPath, VERIFY_MANIFEST_FILENAME);
75
+ }
76
+ /** Throw a manifest error that always names the offending file. */
77
+ function manifestError(path, problem) {
78
+ throw new Error(`Invalid Telora verify manifest at ${path}: ${problem}. `
79
+ + `A malformed manifest is never degraded to "verification disabled" -- fix the file `
80
+ + `or delete it to opt this repo out of the deterministic gate.`);
81
+ }
82
+ /**
83
+ * Validate an optional positive-number refinement field.
84
+ *
85
+ * Present-but-wrong is malformed (loud) for the same reason `command` is: the
86
+ * repo said something we cannot read, and a silent fallback would quietly swap
87
+ * the repo's declared bound for a default.
88
+ */
89
+ function optionalPositiveNumber(raw, key, path) {
90
+ const value = raw[key];
91
+ if (value === undefined)
92
+ return undefined;
93
+ if (typeof value !== 'number' || !Number.isFinite(value) || value <= 0) {
94
+ manifestError(path, `"${key}" must be a number > 0 (got ${JSON.stringify(value)})`);
95
+ }
96
+ return value;
97
+ }
98
+ /**
99
+ * Read the repo's verification manifest.
100
+ *
101
+ * @param repoPath Product repo root (`configForProduct` sets this per product).
102
+ * Undefined => no repo to read => `undefined`.
103
+ * @param fs Injectable fs seam; defaults to real fs.
104
+ * @returns The parsed manifest, or `undefined` when no manifest file exists.
105
+ * @throws Error naming the file path when the manifest exists but is
106
+ * unreadable / not JSON / not an object / carries no usable `command`
107
+ * / carries a non-positive `timeoutMs` or `maxConcurrent`.
108
+ */
109
+ export const readVerifyManifest = (repoPath, fs = defaultVerifyManifestFs) => {
110
+ if (!repoPath)
111
+ return undefined;
112
+ const path = resolveVerifyManifestPath(repoPath);
113
+ if (!fs.exists(path))
114
+ return undefined;
115
+ let text;
116
+ try {
117
+ text = fs.readText(path);
118
+ }
119
+ catch (err) {
120
+ manifestError(path, `file could not be read (${String(err?.message ?? err)})`);
121
+ }
122
+ let parsed;
123
+ try {
124
+ parsed = JSON.parse(text);
125
+ }
126
+ catch (err) {
127
+ manifestError(path, `not valid JSON (${String(err?.message ?? err)})`);
128
+ }
129
+ if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) {
130
+ manifestError(path, `expected a JSON object, got ${Array.isArray(parsed) ? 'an array' : typeof parsed}`);
131
+ }
132
+ const raw = parsed;
133
+ const command = raw.command;
134
+ if (typeof command !== 'string') {
135
+ manifestError(path, command === undefined
136
+ ? `missing required "command" string (check for a typo in the key)`
137
+ : `"command" must be a string (got ${typeof command})`);
138
+ }
139
+ if (command.trim() === '') {
140
+ manifestError(path, `"command" must not be empty -- delete the file to opt out instead`);
141
+ }
142
+ const timeoutMs = optionalPositiveNumber(raw, 'timeoutMs', path);
143
+ const maxConcurrent = optionalPositiveNumber(raw, 'maxConcurrent', path);
144
+ return {
145
+ command,
146
+ ...(timeoutMs !== undefined ? { timeoutMs } : {}),
147
+ ...(maxConcurrent !== undefined ? { maxConcurrent } : {}),
148
+ };
149
+ };
150
+ //# sourceMappingURL=verification-manifest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verification-manifest.js","sourceRoot":"","sources":["../src/verification-manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,oBAAoB,CAAC;AA+B7D,oDAAoD;AACpD,MAAM,CAAC,MAAM,uBAAuB,GAAqB;IACvD,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC;IAClC,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC;CAChD,CAAC;AAQF,0DAA0D;AAC1D,MAAM,UAAU,yBAAyB,CAAC,QAAgB;IACxD,OAAO,OAAO,CAAC,QAAQ,EAAE,wBAAwB,CAAC,CAAC;AACrD,CAAC;AAED,mEAAmE;AACnE,SAAS,aAAa,CAAC,IAAY,EAAE,OAAe;IAClD,MAAM,IAAI,KAAK,CACb,qCAAqC,IAAI,KAAK,OAAO,IAAI;UACvD,oFAAoF;UACpF,8DAA8D,CACjE,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,SAAS,sBAAsB,CAC7B,GAA4B,EAC5B,GAAkC,EAClC,IAAY;IAEZ,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;IACvB,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC1C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,EAAE,CAAC;QACvE,aAAa,CAAC,IAAI,EAAE,IAA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iC,CAAC;IAC9C,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC;IAC5B,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAChC,aAAa,CACX,IAAI,EACJ,OAAO,KAAK,SAAS;YACnB,CAAC,CAAC,iEAAiE;YACnE,CAAC,CAAC,mCAAmC,OAAO,OAAO,GAAG,CACzD,CAAC;IACJ,CAAC;IACD,IAAI,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QAC1B,aAAa,CAAC,IAAI,EAAE,mEAAmE,CAAC,CAAC;IAC3F,CAAC;IAED,MAAM,SAAS,GAAG,sBAAsB,CAAC,GAAG,EAAE,WAAW,EAAE,IAAI,CAAC,CAAC;IACjE,MAAM,aAAa,GAAG,sBAAsB,CAAC,GAAG,EAAE,eAAe,EAAE,IAAI,CAAC,CAAC;IAEzE,OAAO;QACL,OAAO;QACP,GAAG,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACjD,GAAG,CAAC,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC1D,CAAC;AACJ,CAAC,CAAC"}
@@ -31,6 +31,14 @@ export type VerifyClassification = 'match' | 'legitimate_divergence' | 'shortfal
31
31
  export interface VerifyEvidence {
32
32
  /** Delivery diff against the integration branch, when available. */
33
33
  diff?: string;
34
+ /**
35
+ * Files changed between the integration base and the delivery HEAD
36
+ * (name-only). Structured signal so the judge sees WHICH files changed
37
+ * without parsing the raw diff.
38
+ */
39
+ changedFiles?: string[];
40
+ /** `git diff --stat` summary between the integration base and HEAD. */
41
+ diffStat?: string;
34
42
  /** Captured stdout from a deterministic check (tests/lint/types). */
35
43
  testStdout?: string;
36
44
  /** Captured stderr from a deterministic check. */
@@ -54,9 +62,16 @@ export interface ReconcileJudgment {
54
62
  classification: VerifyClassification;
55
63
  /** Populated only on legitimate_divergence / shortfall: what the gap is. */
56
64
  divergenceReason?: string;
65
+ /**
66
+ * REQUIRED on a shortfall: the diff evidence (file / hunk) whose absence
67
+ * justifies marking the declared node short. A shortfall grounded only in
68
+ * test output or verdict rationale -- not the diff -- is not a valid
69
+ * shortfall. Omitted on match / legitimate_divergence.
70
+ */
71
+ diffCitation?: string;
57
72
  }
58
73
  export type ReconcileOptions = RestatementOptions;
59
- export declare const RECONCILE_SYSTEM_PROMPT = "You reconcile a software delivery's DECLARED desired effect against what its worktree EVIDENCE actually shows was accomplished, for a Goldratt reality-tree flip.\n\nYou will be given:\n- The DECLARED desired effect: the outcome the work was supposed to realize. This is the intent of record. Do NOT lower it.\n- EVIDENCE from the worktree: the code diff, test/lint/type output, and/or an inspection finding. This is the only ground truth for what was actually achieved.\n\nDo TWO things:\n1. Author the ACHIEVED desired effect: ONE concrete positive sentence describing what the EVIDENCE shows was accomplished. Derive it from the evidence, NOT from the declared sentence -- if the evidence accomplished something different from or narrower than the declaration, the achieved sentence must say what the evidence shows, not echo the declaration.\n2. Classify how the achieved outcome compares to the declared desired effect:\n - \"match\": the achieved outcome realizes the declared intent.\n - \"legitimate_divergence\": the achieved outcome differs from the declared intent but is a valid, defensible result (e.g. a better approach, an equivalent substitution). Give a one-sentence reason naming the gap.\n - \"shortfall\": the achieved outcome falls short of the declared intent -- it does less, is incomplete, or the evidence does not support the declaration. Give a one-sentence reason naming what is missing.\n\nRespond with ONE JSON object and nothing else:\n{\"achievedStatement\": \"<one sentence>\", \"classification\": \"match\" | \"legitimate_divergence\" | \"shortfall\", \"divergenceReason\": \"<one sentence, omit or empty when classification is match>\"}";
74
+ export declare const RECONCILE_SYSTEM_PROMPT = "You reconcile a software delivery's DECLARED desired effect against what its worktree EVIDENCE actually shows was accomplished, for a Goldratt reality-tree flip.\n\nYou will be given:\n- The DECLARED desired effect: the outcome the work was supposed to realize. This is the intent of record. Do NOT lower it.\n- EVIDENCE from the worktree: the code diff, test/lint/type output, and/or an inspection finding. This is the only ground truth for what was actually achieved.\n\nThe CODE DIFF is the PRIMARY evidence for what was delivered. Ground your judgment in it. Test/lint output and inspection findings are corroborating evidence -- they show that code RUNS, not WHICH declared behavior it implements. Never conclude a shortfall from test output alone: if the diff implements the declared behavior, it is not short even if the tests you see are about something else.\n\nDo TWO things:\n1. Author the ACHIEVED desired effect: ONE concrete positive sentence describing what the EVIDENCE shows was accomplished. Derive it from the evidence, NOT from the declared sentence -- if the evidence accomplished something different from or narrower than the declaration, the achieved sentence must say what the evidence shows, not echo the declaration.\n2. Classify how the achieved outcome compares to the declared desired effect:\n - \"match\": the achieved outcome realizes the declared intent.\n - \"legitimate_divergence\": the achieved outcome differs from the declared intent but is a valid, defensible result (e.g. a better approach, an equivalent substitution). Give a one-sentence reason naming the gap.\n - \"shortfall\": the achieved outcome falls short of the declared intent -- it does less, is incomplete, or the evidence does not support the declaration. Give a one-sentence reason naming what is missing, AND cite the diff: name the changed file(s)/hunk you inspected whose content fails to satisfy the declared node (or state that the diff contains no change addressing it). A shortfall MUST be grounded in the diff -- if you cannot locate the declared behavior's absence in the diff, it is not a shortfall.\n\nRespond with ONE JSON object and nothing else:\n{\"achievedStatement\": \"<one sentence>\", \"classification\": \"match\" | \"legitimate_divergence\" | \"shortfall\", \"divergenceReason\": \"<one sentence, omit or empty when classification is match>\", \"diffCitation\": \"<REQUIRED on shortfall: the file/hunk in the diff whose absence justifies the shortfall; omit on match/legitimate_divergence>\"}";
60
75
  export declare function buildReconcileSystemPrompt(): string;
61
76
  /** Render the cited evidence into the user message. Evidence-only -- the UDE text is never included. */
62
77
  export declare function buildReconcileUserMessage(inputs: ReconcileInputs): string;
@@ -1 +1 @@
1
- {"version":3,"file":"verify-reconciliation.d.ts","sourceRoot":"","sources":["../src/verify-reconciliation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,qBAAqB,CAAC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AAgB,0BAA0B,IAAI,MAAM,CAEnD;AAED,wGAAwG;AACxG,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,eAAe,GAAG,MAAM,CA4CzE;AAED,8DAA8D;AAC9D,wBAAgB,eAAe,CAAC,EAAE,EAAE,cAAc,GAAG,OAAO,CAQ3D;AAED,kFAAkF;AAClF,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,iBAAiB,GAAG,IAAI,CAsDxE;AAED;;;;;;GAMG;AACH,wBAAsB,uBAAuB,CAC3C,MAAM,EAAE,eAAe,EACvB,IAAI,GAAE,gBAAqB,GAC1B,OAAO,CAAC,iBAAiB,CAAC,CAkB5B"}
@@ -31,15 +31,17 @@ You will be given:
31
31
  - The DECLARED desired effect: the outcome the work was supposed to realize. This is the intent of record. Do NOT lower it.
32
32
  - EVIDENCE from the worktree: the code diff, test/lint/type output, and/or an inspection finding. This is the only ground truth for what was actually achieved.
33
33
 
34
+ The CODE DIFF is the PRIMARY evidence for what was delivered. Ground your judgment in it. Test/lint output and inspection findings are corroborating evidence -- they show that code RUNS, not WHICH declared behavior it implements. Never conclude a shortfall from test output alone: if the diff implements the declared behavior, it is not short even if the tests you see are about something else.
35
+
34
36
  Do TWO things:
35
37
  1. Author the ACHIEVED desired effect: ONE concrete positive sentence describing what the EVIDENCE shows was accomplished. Derive it from the evidence, NOT from the declared sentence -- if the evidence accomplished something different from or narrower than the declaration, the achieved sentence must say what the evidence shows, not echo the declaration.
36
38
  2. Classify how the achieved outcome compares to the declared desired effect:
37
39
  - "match": the achieved outcome realizes the declared intent.
38
40
  - "legitimate_divergence": the achieved outcome differs from the declared intent but is a valid, defensible result (e.g. a better approach, an equivalent substitution). Give a one-sentence reason naming the gap.
39
- - "shortfall": the achieved outcome falls short of the declared intent -- it does less, is incomplete, or the evidence does not support the declaration. Give a one-sentence reason naming what is missing.
41
+ - "shortfall": the achieved outcome falls short of the declared intent -- it does less, is incomplete, or the evidence does not support the declaration. Give a one-sentence reason naming what is missing, AND cite the diff: name the changed file(s)/hunk you inspected whose content fails to satisfy the declared node (or state that the diff contains no change addressing it). A shortfall MUST be grounded in the diff -- if you cannot locate the declared behavior's absence in the diff, it is not a shortfall.
40
42
 
41
43
  Respond with ONE JSON object and nothing else:
42
- {"achievedStatement": "<one sentence>", "classification": "match" | "legitimate_divergence" | "shortfall", "divergenceReason": "<one sentence, omit or empty when classification is match>"}`;
44
+ {"achievedStatement": "<one sentence>", "classification": "match" | "legitimate_divergence" | "shortfall", "divergenceReason": "<one sentence, omit or empty when classification is match>", "diffCitation": "<REQUIRED on shortfall: the file/hunk in the diff whose absence justifies the shortfall; omit on match/legitimate_divergence>"}`;
43
45
  export function buildReconcileSystemPrompt() {
44
46
  return RECONCILE_SYSTEM_PROMPT;
45
47
  }
@@ -48,6 +50,14 @@ export function buildReconcileUserMessage(inputs) {
48
50
  const parts = [`Declared desired effect:\n${inputs.declaredStatement}`];
49
51
  const ev = inputs.evidence;
50
52
  const evidenceSections = [];
53
+ // Structured diff signals FIRST -- the judge can see which files/tests
54
+ // changed without parsing the full diff.
55
+ if (ev.changedFiles && ev.changedFiles.length > 0) {
56
+ evidenceSections.push(`Changed files (${ev.changedFiles.length}):\n${ev.changedFiles.map((f) => `- ${f}`).join('\n')}`);
57
+ }
58
+ if (ev.diffStat && ev.diffStat.trim() !== '') {
59
+ evidenceSections.push(`Diff stat:\n${ev.diffStat.trim()}`);
60
+ }
51
61
  if (ev.diff && ev.diff.trim() !== '') {
52
62
  evidenceSections.push(`Code diff (against integration):\n${ev.diff}`);
53
63
  }
@@ -126,6 +136,7 @@ export function parseReconcileJson(raw) {
126
136
  return null;
127
137
  }
128
138
  const reasonRaw = typeof obj.divergenceReason === 'string' ? obj.divergenceReason.trim() : '';
139
+ const citationRaw = typeof obj.diffCitation === 'string' ? obj.diffCitation.trim() : '';
129
140
  const judgment = {
130
141
  achievedStatement: achieved,
131
142
  classification,
@@ -133,6 +144,11 @@ export function parseReconcileJson(raw) {
133
144
  if (classification !== 'match' && reasonRaw !== '') {
134
145
  judgment.divergenceReason = reasonRaw;
135
146
  }
147
+ // The diff citation is meaningful only on a shortfall (it grounds the
148
+ // withheld flip in the diff). Carry it through when the judge supplied one.
149
+ if (classification === 'shortfall' && citationRaw !== '') {
150
+ judgment.diffCitation = citationRaw;
151
+ }
136
152
  return judgment;
137
153
  }
138
154
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"verify-reconciliation.js","sourceRoot":"","sources":["../src/verify-reconciliation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EACL,eAAe,GAEhB,MAAM,qBAAqB,CAAC;AAsC7B,MAAM,CAAC,MAAM,uBAAuB,GAAG;;;;;;;;;;;;;;6LAcsJ,CAAC;AAE9L,MAAM,UAAU,0BAA0B;IACxC,OAAO,uBAAuB,CAAC;AACjC,CAAC;AAED,wGAAwG;AACxG,MAAM,UAAU,yBAAyB,CAAC,MAAuB;IAC/D,MAAM,KAAK,GAAa,CAAC,6BAA6B,MAAM,CAAC,iBAAiB,EAAE,CAAC,CAAC;IAClF,MAAM,EAAE,GAAG,MAAM,CAAC,QAAQ,CAAC;IAC3B,MAAM,gBAAgB,GAAa,EAAE,CAAC;IAEtC,IAAI,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QACrC,gBAAgB,CAAC,IAAI,CAAC,qCAAqC,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC;IACxE,CAAC;IACD,IAAI,OAAO,EAAE,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;QACpC,gBAAgB,CAAC,IAAI,CAAC,kCAAkC,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC;IACzE,CAAC;IACD,IAAI,EAAE,CAAC,UAAU,IAAI,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QACjD,gBAAgB,CAAC,I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;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,MAAuB,EACvB,OAAyB,EAAE;IAE3B,MAAM,YAAY,GAAG,0BAA0B,EAAE,CAAC;IAClD,MAAM,WAAW,GAAG,yBAAyB,CAAC,MAAM,CAAC,CAAC;IACtD,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,IAAI,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC;IACnF,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC;IACpD,MAAM,QAAQ,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;IACzC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;IAC1E,CAAC;IACD,6EAA6E;IAC7E,iEAAiE;IACjE,IAAI,QAAQ,CAAC,cAAc,KAAK,OAAO,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE,CAAC;QACtE,QAAQ,CAAC,gBAAgB;YACvB,QAAQ,CAAC,cAAc,KAAK,WAAW;gBACrC,CAAC,CAAC,8DAA8D;gBAChE,CAAC,CAAC,6DAA6D,CAAC;IACtE,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -58,6 +58,13 @@ export interface TargetShortfall {
58
58
  achievedStatement: string;
59
59
  /** Why the achieved outcome falls short. */
60
60
  reason: string;
61
+ /**
62
+ * The diff evidence (file / hunk) whose absence grounds the shortfall, when
63
+ * the reconciliation supplied one. A shortfall grounded only in test output
64
+ * -- not the diff -- leaves this undefined; readers should treat an
65
+ * un-cited shortfall as weaker signal than a cited one.
66
+ */
67
+ diffCitation?: string;
61
68
  }
62
69
  export interface ReconcileTargetsResult {
63
70
  /** match / legitimate_divergence -- safe to carry into verify. */
@@ -1 +1 @@
1
- {"version":3,"file":"verify-restatement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AAE,eAAe,EAAE,CAAC;IAC9B;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,MAAM,WAAW,GAAG,CACxB,MAAM,EAAE,eAAe,EACvB,IAAI,CAAC,EAAE,gBAAgB,KACpB,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAEhC,MAAM,WAAW,4BAA4B;IAC3C,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;IAC9E,oGAAoG;IACpG,SAAS,CAAC,EAAE,WAAW,CAAC;CACzB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAsB,wBAAwB,CAC5C,eAAe,EAAE,MAAM,EACvB,OAAO,EAAE,MAAM,GAAG,IAAI,EACtB,QAAQ,EAAE,cAAc,EACxB,IAAI,GAAE,4BAAiC,GACtC,OAAO,CAAC,sBAAsB,CAAC,CA0FjC"}
@@ -126,6 +126,7 @@ export async function authorTargetRestatements(injectionNodeId, focusId, evidenc
126
126
  achievedStatement: judgment.achievedStatement,
127
127
  reason: judgment.divergenceReason
128
128
  ?? 'Achieved outcome falls short of the declared desired effect.',
129
+ ...(judgment.diffCitation ? { diffCitation: judgment.diffCitation } : {}),
129
130
  });
130
131
  continue;
131
132
  }
@@ -1 +1 @@
1
- {"version":3,"file":"verify-restatement.js","sourceRoot":"","sources":["../src/verify-restatement.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EACL,uBAAuB,IAAI,gBAAgB,GAM5C,MAAM,4BAA4B,CAAC;AAsEpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,CAAC,KAAK,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"version": "0.20.19",
3
+ "version": "0.20.28",
4
4
  "description": "Agent orchestration daemon for Telora - spawns and manages Claude Code instances",
5
5
  "type": "module",
6
6
  "bin": {
@@ -38,7 +38,7 @@
38
38
  "//testRunner": "Uses Node.js built-in test runner (node:test) via tsx for TypeScript support. The root package uses Vitest; this is a deliberate choice for the daemon package to avoid framework dependencies. See src/__tests__/ for test files.",
39
39
  "dependencies": {
40
40
  "@telora/daemon": "^0.20.0",
41
- "@telora/daemon-core": "^0.2.70",
41
+ "@telora/daemon-core": "^0.2.72",
42
42
  "@telora/mcp-products": "^0.22.104",
43
43
  "commander": "^14.0.3",
44
44
  "yaml": "^2.4.0",
@@ -1,68 +0,0 @@
1
- /**
2
- * Periodic drift auto-ratification tick.
3
- *
4
- * Lists `proposed` drift proposals per product, runs each through the
5
- * fail-closed policy in `drift-ratify-policy.ts`, and ratifies the ones the
6
- * daemon is sanctioned to ratify unattended. Proposals the policy routes to a
7
- * review session (`review_dispose`) or refuses to classify (`hold`) are left
8
- * in `proposed`, untouched.
9
- *
10
- * WHAT THIS CLOSES. Drift proposals pooled in `proposed` faster than a human
11
- * could ratify them, so the reality tree lagged observed reality and every
12
- * consumer of the graph (audit assembly, propose_injections, focus.context)
13
- * computed against a stale intent model. The ledger is unchanged -- this only
14
- * changes WHO ratifies. Ratified proposals still reach the graph exclusively
15
- * via the existing realign_crt phase (`applyRatifiedProposals`), which this
16
- * module does not touch.
17
- *
18
- * WHAT THIS MUST NEVER DO. Ratify an inward shortfall. That is the machine
19
- * rewriting a claim its own work failed to meet. The policy module owns that
20
- * decision; this tick owns only list -> classify -> ratify-the-safe-ones, and
21
- * deliberately contains no safe-kind rules of its own. If you find yourself
22
- * adding kind logic here, it belongs in drift-ratify-policy.ts.
23
- *
24
- * ACTOR STAMP. The tick calls `crt_drift_proposal_ratify` with no session id.
25
- * The edge handler resolves the actor from the caller's credential kind, so a
26
- * tracker-authenticated daemon call is recorded as `ratified_by_kind='system'`
27
- * with `ratified_by=NULL` automatically. Passing a session id would instead
28
- * stamp `review_session` -- that is the review-disposition path, not this one.
29
- *
30
- * Activation: opt-out via TELORA_DRIFT_RATIFY_LOOP=0. See `shouldRunLoop()` in
31
- * focus-engine.ts.
32
- *
33
- * @module drift-ratify-loop
34
- */
35
- import type { DaemonConfig } from './types.js';
36
- export interface DriftRatifyTickResult {
37
- productsScanned: number;
38
- /** Products skipped this tick because they are within a list-failure backoff window. */
39
- productsSkipped: number;
40
- proposalsExamined: number;
41
- /** Ratified by the daemon with the system actor stamp. */
42
- ratified: number;
43
- /** Left proposed: the shortfall channel, owed to an independent review session. */
44
- leftForReview: number;
45
- /** Left proposed: fail-closed (unknown kind, malformed metadata, inconsistent row). */
46
- held: number;
47
- errors: number;
48
- }
49
- export interface DriftRatifyLoopDeps {
50
- callApi: <T>(action: string, params?: Record<string, unknown>) => Promise<T>;
51
- /** Clock seam (epoch ms) for the per-product list-failure backoff. */
52
- now: () => number;
53
- /** Backoff window applied to a product after a list failure. */
54
- listBackoffMs: number;
55
- }
56
- /** Test-only: clear the per-product list-failure backoff state. */
57
- export declare function __resetDriftRatifyBackoffForTesting(): void;
58
- /**
59
- * Run one auto-ratification tick across every product in the daemon config.
60
- *
61
- * Per-proposal failures are counted and skipped, never aborting the batch --
62
- * one unratifiable proposal must not strand the rest of the stream (mirrors
63
- * `applyRatifiedProposals`, realign-apply.ts:403-416).
64
- *
65
- * Returns counters useful for log lines and tests.
66
- */
67
- export declare function runDriftRatifyTick(config: DaemonConfig, depOverrides?: Partial<DriftRatifyLoopDeps>): Promise<DriftRatifyTickResult>;
68
- //# sourceMappingURL=drift-ratify-loop.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"drift-ratify-loop.d.ts","sourceRoot":"","sources":["../src/drift-ratify-loop.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AA0B/C,MAAM,WAAW,qBAAqB;IACpC,eAAe,EAAE,MAAM,CAAC;IACxB,wFAAwF;IACxF,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,0DAA0D;IAC1D,QAAQ,EAAE,MAAM,CAAC;IACjB,mFAAmF;IACnF,aAAa,EAAE,MAAM,CAAC;IACtB,uFAAuF;IACvF,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;IAC7E,sEAAsE;IACtE,GAAG,EAAE,MAAM,MAAM,CAAC;IAClB,gEAAgE;IAChE,aAAa,EAAE,MAAM,CAAC;CACvB;AA4BD,mEAAmE;AACnE,wBAAgB,mCAAmC,IAAI,IAAI,CAE1D;AAUD;;;;;;;;GAQG;AACH,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,YAAY,EACpB,YAAY,GAAE,OAAO,CAAC,mBAAmB,CAAM,GAC9C,OAAO,CAAC,qBAAqB,CAAC,CA6FhC"}