@quolu/lattice 0.111.0 → 0.111.1
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/package.json +1 -1
- package/src/todo-cli.mjs +4 -2
- package/src/todo-declaration.mjs +6 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quolu/lattice",
|
|
3
|
-
"version": "0.111.
|
|
3
|
+
"version": "0.111.1",
|
|
4
4
|
"description": "Schedulability compiler for multi-agent development: observe real code boundaries, refactor the conflicting seam, recompile the plan for parallel execution",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Quo / クオ at kitepon.dev",
|
package/src/todo-cli.mjs
CHANGED
|
@@ -1818,8 +1818,10 @@ async function declareOnAdd({ repoRoot, planKey, taskId, flags }) {
|
|
|
1818
1818
|
return { written: false, resolved: [], unresolved: [], malformed: [], proposed };
|
|
1819
1819
|
}
|
|
1820
1820
|
try {
|
|
1821
|
-
const
|
|
1822
|
-
|
|
1821
|
+
const { declaration } = await declareTaskRow({ repoRoot, planKey, taskId, flags, observable: headResolves(repoRoot) });
|
|
1822
|
+
// as witness declare: a row not written says what to correct and that the same flags go to `witness declare` (ADR 0204 §7.4)
|
|
1823
|
+
return declaration.written || declaration.malformed.length + declaration.unresolved.length === 0 ? declaration
|
|
1824
|
+
: { ...declaration, next_action: declarationNextAction(planKey, taskId, declaration) };
|
|
1823
1825
|
} catch (error) {
|
|
1824
1826
|
if (!(error instanceof TodoStoreError)) throw error;
|
|
1825
1827
|
return { written: false, resolved: [], unresolved: [], malformed: [],
|
package/src/todo-declaration.mjs
CHANGED
|
@@ -89,6 +89,10 @@ async function wholeFiles({ root, observable, bare, files, text }) {
|
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
+
/** ADR 0204 §7.4: a new name says so to the member it concerns; the nearest name only when there is one. */
|
|
93
|
+
const newNameEntry = ({ path: where, symbol, nearest = [], elsewhere = [] }) => ({ path: where, symbol, nearest, elsewhere,
|
|
94
|
+
text: `${where}#${symbol}: not in the code, recorded as a new function${nearest.length > 0 ? `; if you meant ${nearest[0]}, declare again with that name` : ''}` });
|
|
95
|
+
|
|
92
96
|
const unresolvedEntry = (anchor, reason, nearest = [], elsewhere = []) => ({
|
|
93
97
|
path: anchor.path, symbol: anchor.symbol, reason, nearest, elsewhere,
|
|
94
98
|
});
|
|
@@ -119,7 +123,7 @@ export async function buildDeclarationRow({ root, observable, owns, reads, write
|
|
|
119
123
|
declaration.unresolved = wanted.map((anchor) => unresolvedEntry(anchor, reason));
|
|
120
124
|
return { row: null, declaration };
|
|
121
125
|
}
|
|
122
|
-
declaration.new_names = wanted.map(
|
|
126
|
+
declaration.new_names = wanted.map(newNameEntry);
|
|
123
127
|
return buildRow({ own, read, writes, declaration, ranges, isNew: () => true });
|
|
124
128
|
};
|
|
125
129
|
if (wanted.length > 0 && !observable) return everyNew('no_code_tree');
|
|
@@ -142,10 +146,7 @@ export async function buildDeclarationRow({ root, observable, owns, reads, write
|
|
|
142
146
|
// path_invalid / symbol_empty cannot be stored at all; every other miss is a name that does not exist yet.
|
|
143
147
|
const unreadable = mine.filter(({ reason }) => strict || reason === 'path_invalid' || reason === 'symbol_empty');
|
|
144
148
|
declaration.unresolved = unreadable.map(entry);
|
|
145
|
-
declaration.new_names = mine.filter((anchor) => !unreadable.includes(anchor)).map((anchor) =>
|
|
146
|
-
const { path: where, symbol, nearest, elsewhere } = entry(anchor);
|
|
147
|
-
return { path: where, symbol, nearest, elsewhere };
|
|
148
|
-
});
|
|
149
|
+
declaration.new_names = mine.filter((anchor) => !unreadable.includes(anchor)).map((anchor) => newNameEntry(entry(anchor)));
|
|
149
150
|
newKeys = new Set(declaration.new_names.map(keyOf));
|
|
150
151
|
ranges = answer.resolved;
|
|
151
152
|
declaration.resolved = answer.resolved.filter(({ path: where, symbol }) => wantedKeys.has(`${where}\0${symbol}`))
|