@quolu/lattice 0.58.1 → 0.58.2

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quolu/lattice",
3
- "version": "0.58.1",
3
+ "version": "0.58.2",
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
@@ -2035,10 +2035,7 @@ async function structureCompile({ repoRoot, env, planKey, inputRef }) {
2035
2035
  const overlay = compileTodoStructureOverlay({
2036
2036
  structureSet,
2037
2037
  topology: mergedTopology(store),
2038
- taskStates: structureSet.tasks.map(({ task_id: taskId }) => ({
2039
- task_id: taskId,
2040
- status: member.tasks.find(({ task_id: id }) => id === taskId)?.status ?? 'pending',
2041
- })),
2038
+ taskStates: member.tasks.map(({ task_id: taskId, status }) => ({ task_id: taskId, status })),
2042
2039
  sourceProjection: sourceEvidence.projection,
2043
2040
  gitProvenance,
2044
2041
  realizations,
@@ -2196,7 +2193,7 @@ async function structureFinalize({ repoRoot, env, planKey }) {
2196
2193
  const overlay = compileTodoStructureOverlay({
2197
2194
  structureSet: source,
2198
2195
  topology: mergedTopology(store),
2199
- taskStates: source.tasks.map(({ task_id: taskId }) => ({ task_id: taskId, status: 'done' })),
2196
+ taskStates: member.tasks.map(({ task_id: taskId, status }) => ({ task_id: taskId, status })),
2200
2197
  sourceProjection: sourceEvidence.projection,
2201
2198
  gitProvenance,
2202
2199
  realizations,
@@ -62,12 +62,14 @@ function normalizeTaskStates(structureSet, taskStates) {
62
62
  if (!isPlain(entry) || Object.keys(entry).length !== 2
63
63
  || typeof entry.task_id !== 'string'
64
64
  || !['pending', 'in-progress', 'blocked', 'done'].includes(entry.status)
65
- || !expected.has(entry.task_id) || states.has(entry.task_id)) {
65
+ || states.has(entry.task_id)) {
66
66
  fail('STRUCTURE_OVERLAY_INPUT_INVALID', 'task_state_entry_invalid');
67
67
  }
68
68
  states.set(entry.task_id, entry.status);
69
69
  }
70
- if (states.size !== expected.size) fail('STRUCTURE_OVERLAY_INPUT_INVALID', 'task_state_coverage_invalid');
70
+ if ([...expected].some((taskId) => !states.has(taskId))) {
71
+ fail('STRUCTURE_OVERLAY_INPUT_INVALID', 'task_state_coverage_invalid');
72
+ }
71
73
  return states;
72
74
  }
73
75
 
@@ -302,7 +304,7 @@ function buildOverlayGraph(structureSet, states, latestRealizations, sourceProje
302
304
  return { nodes: uniqueNodes, edges, effective };
303
305
  }
304
306
 
305
- function connectionFindings(structureSet, effective, topologyDag) {
307
+ function connectionFindings(structureSet, effective, topologyDag, states) {
306
308
  const findings = [];
307
309
  const externalById = new Map(structureSet.external_contracts
308
310
  .map((external) => [external.contract_id, external]));
@@ -322,7 +324,8 @@ function connectionFindings(structureSet, effective, topologyDag) {
322
324
  const structureTaskIds = new Set(structureSet.tasks.map(({ task_id: id }) => id));
323
325
  const extraTopologyTasks = topologyDag.nodes
324
326
  .filter(({ ref }) => ref.project_id === structureSet.project_id
325
- && ref.plan_key === structureSet.plan_key && !structureTaskIds.has(ref.task_id))
327
+ && ref.plan_key === structureSet.plan_key && !structureTaskIds.has(ref.task_id)
328
+ && states.get(ref.task_id) !== 'done')
326
329
  .map(({ ref }) => ref.task_id).sort(compareText);
327
330
  if (extraTopologyTasks.length > 0) findings.push(finding({
328
331
  code: 'STRUCTURE_COVERAGE_MISSING', severity: 'error', taskIds: extraTopologyTasks,
@@ -557,7 +560,7 @@ export function compileTodoStructureOverlay({
557
560
  const rawFindings = [
558
561
  ...anchorFindings(structureSet, sourceProjection),
559
562
  ...missingEffectiveAnchors,
560
- ...connectionFindings(structureSet, graph.effective, topologyDag),
563
+ ...connectionFindings(structureSet, graph.effective, topologyDag, states),
561
564
  ...realizationFindings(
562
565
  structureSet, states, normalizedRealizations, gitProvenance, graph.effective,
563
566
  ),