@polycode-projects/the-mechanical-code-talker 2.7.22 → 2.7.23
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/services/spider-fly.mjs +14 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@polycode-projects/the-mechanical-code-talker",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.23",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "The Mechanical Code Talker (tmct) — a tolerant, offline, $0 chat surface that guides you toward precision queries about a software repository. ELIZA/PARRY-style but domain-obsessed with code. No model calls; no codebase index of its own.",
|
|
@@ -368,7 +368,7 @@ function mostRecentEaterSpider(state, eatenDeltaBySpider) {
|
|
|
368
368
|
export function runEcologyPass({ state, postMovePlacements, postMoveMassByFly, postMoveMassBySpider = new Map(), turn }) {
|
|
369
369
|
const k = turn;
|
|
370
370
|
const writes = [];
|
|
371
|
-
const events = { eaten: [], starved: [], laid: null, hatched: [], spawned: null, massAfterEating: new Map() };
|
|
371
|
+
const events = { eaten: [], starved: [], laid: null, hatched: [], spawned: null, spawnedCell: null, massAfterEating: new Map() };
|
|
372
372
|
|
|
373
373
|
const spiders = [...postMovePlacements.keys()].filter((id) => /^spider-\d+$/.test(id)).sort();
|
|
374
374
|
const flies = [...postMovePlacements.keys()].filter((id) => /^fly-\d+$/.test(id)).sort();
|
|
@@ -481,6 +481,7 @@ export function runEcologyPass({ state, postMovePlacements, postMoveMassByFly, p
|
|
|
481
481
|
writes.push({ subject: `${newFlyId}@turn${k}`, predicate: "mgx:currently-in", object: cell });
|
|
482
482
|
writes.push({ subject: `${newFlyId}@turn${k}`, predicate: "mgx:mass", object: String(FLY_INITIAL_MASS) });
|
|
483
483
|
events.spawned = newFlyId;
|
|
484
|
+
events.spawnedCell = cell;
|
|
484
485
|
}
|
|
485
486
|
}
|
|
486
487
|
|
|
@@ -697,6 +698,18 @@ export async function runSpiderFlyTick(memoryDir, opts = {}) {
|
|
|
697
698
|
}
|
|
698
699
|
}
|
|
699
700
|
for (const flyId of ecology.events.starved) delete agents[flyId];
|
|
701
|
+
// A hatched spider or a spawned fly is minted by the ecology pass, which
|
|
702
|
+
// runs AFTER the movement loops above already built `agents` from the
|
|
703
|
+
// pre-tick roster — so without this, a brand-new individual is absent from
|
|
704
|
+
// this tick's own returned agents (and so invisible on the board/HUD) even
|
|
705
|
+
// though the very same tick's event text already announces it, only
|
|
706
|
+
// catching up the following tick once the fold picks it up naturally.
|
|
707
|
+
for (const h of ecology.events.hatched) {
|
|
708
|
+
agents[h.spider] = { cell: h.cell, goal: "just hatched — no goal yet.", plan: null, mass: SPIDER_INITIAL_MASS };
|
|
709
|
+
}
|
|
710
|
+
if (ecology.events.spawned && ecology.events.spawnedCell) {
|
|
711
|
+
agents[ecology.events.spawned] = { cell: ecology.events.spawnedCell, goal: "just arrived — no goal yet.", mass: FLY_INITIAL_MASS };
|
|
712
|
+
}
|
|
700
713
|
const writes = [...movementWrites, ...ecology.writes];
|
|
701
714
|
const provenance = `${worldProvenanceTag(WORLD_NAME)}:turn${k}`;
|
|
702
715
|
await appendFacts(memoryDir, writes.map((f) => ({ ...f, provenance })));
|