{"draft":null,"from":123,"to":124,"files":[{"path":"src/engine/build.ts","added":24,"removed":5,"diff":"--- a/src/engine/build.ts\n+++ b/src/engine/build.ts\n@@ -333,7 +333,12 @@\n  * - creating a file over a deleted one: the atoms that deleted its lines;\n  * - needs and resolves.\n  * Nothing else from the view: not the line below an insertion, not the\n- * tombstones around it.\n+ * tombstones around it. New atoms encode implicit dependencies as maximal\n+ * tips: ancestors reachable through another tip are omitted from direct deps.\n+ * Explicit needs/resolves always remain direct. Existing atoms are not rewritten.\n+ * Direct-edge diagnostics (including why/Deps trailers and missingDeps) therefore\n+ * show fewer redundant edges; transitive closure and dependency ordering remain\n+ * the semantic contract. A missing tip still implies its required ancestors.\n  */\n function deriveDeps(\n \tview: View,\n@@ -347,16 +352,30 @@\n \t},\n ): AtomId[] {\n \tconst graph = view.graph;\n-\tconst deps = new Set<AtomId>(parts.emptiedBy);\n+\t// New atoms retain maximal implicit dependencies. Their transitive closure is\n+\t// unchanged; explicit needs/resolves remain direct edges below.\n+\tconst deps = new Set<AtomId>();\n+\tconst addImplicit = (candidate: AtomId): void => {\n+\t\tif (deps.has(candidate)) return;\n+\t\tconst candidateClock = graph.lamport(candidate);\n+\t\tfor (const previous of deps) {\n+\t\t\tconst previousClock = graph.lamport(previous);\n+\t\t\t// Equal Lamport clocks cannot reach each other; check only the possible direction.\n+\t\t\tif (previousClock > candidateClock && graph.dependsOn(previous, candidate)) return;\n+\t\t\tif (candidateClock > previousClock && graph.dependsOn(candidate, previous)) deps.delete(previous);\n+\t\t}\n+\t\tdeps.add(candidate);\n+\t};\n+\tfor (const id of parts.emptiedBy) addImplicit(id);\n \tfor (const key of [...parts.writes, ...parts.reads, ...parts.holds]) {\n \t\tconst { kind, node } = parseKey(key);\n \t\t// An attribute builds on whoever set it last in the view, the way an insertion builds on a gap's writers;\n \t\t// a move builds on the earlier moves of its lines.\n-\t\tif (kind !== \"attr\" && !isStartNode(node)) deps.add(writerOf(node));\n-\t\tif (kind !== \"line\") for (const writer of graph.eachWriterOf(key)) if (view.set.has(writer)) deps.add(writer);\n+\t\tif (kind !== \"attr\" && !isStartNode(node)) addImplicit(writerOf(node));\n+\t\tif (kind !== \"line\") for (const writer of graph.eachWriterOf(key)) if (view.set.has(writer)) addImplicit(writer);\n \t}\n \tfor (const key of parts.writes) {\n-\t\tfor (const reader of graph.eachReaderOf(key)) if (view.set.has(reader)) deps.add(reader);\n+\t\tfor (const reader of graph.eachReaderOf(key)) if (view.set.has(reader)) addImplicit(reader);\n \t}\n \tfor (const id of parts.needs) deps.add(id);\n \tfor (const id of parts.resolves) deps.add(id);"}],"unmatched":[]}