Skip to content

unchallenged_chain anchors on the wrong end of the chain? #155

Description

@justinstimatze

Ran into this while looking at #150. It's a separate thing and it predates that fix, so I'm filing it on its own.

extract-prompt.ts describes depends_on as "one claim only holds if another premise is true", so in {from, to} the premise is the to. detectLoadBearingVibes reads it that way too — it counts incoming edges and calls them "holding up a few things".

The chain detectors go the other direction. longestChainNodesFrom follows outgoing edges, so chain[0] is the most-derived claim and the premise ends up at the far end. Both chain detectors anchor on chain[0].

Small repro — with d1 depends_on p, d2 depends_on d1, d3 depends_on d2, the premise is p:

detectUnchallengedChain → anchors on d3

The rendered phrasing is "A lot of things follow from '{claim}' … worth a 'what if not' pass", which describes a premise, but {claim} gets filled with the conclusion. So the nudge points at the wrong claim. productive_stress_test behaves the same way.

I can't tell which half is wrong:

  • if the anchor is wrong, it wants to be chain[chain.length - 1], and anchor-head.test.ts needs flipping (it currently asserts the head and calls it the premise)
  • if the anchor is right, then the comments and the phrasing are what need fixing

Happy to send a PR either way. Also happy to close it if I've got the edge convention backwards.

One unrelated thing in the same function: the byAnchor dedupe looks dead, since chain[0] is always the start node so the anchors are already unique.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions