PR2: Session-node data quality — working_dir + agent + heal-forward - #87
Closed
Diego Colombo (colombod) wants to merge 1 commit into
Closed
PR2: Session-node data quality — working_dir + agent + heal-forward#87Diego Colombo (colombod) wants to merge 1 commit into
Diego Colombo (colombod) wants to merge 1 commit into
Conversation
This was referenced Aug 26, 2026
…eteSession heal-forward Session-node data-quality changes, stacked on the durable-ingest cursor work. No cursor/queue code -- that lives in the base branch underneath. working_dir is now a complete feature: EventRequest accepts an optional top-level working_dir envelope field (blank/whitespace-only rejected), the events endpoint lifts it into the event data, and ensure_session_node writes it onto the Session node. Populate-if-missing -- a node created before working_dir was known is backfilled by the first subsequent event carrying a non-empty value; an already-set value is never overwritten (the Neo4j write uses coalesce(n.working_dir, row.working_dir) rather than last-write-wins, and working_dir is excluded from the blind SET n += row.props). agent is backfilled on the existing-node branch with the same populate-if-missing rule. The agent name for a spawned sub-session arrives only on the parent's delegate:agent_spawned event, but the child's own session:start can create the node first, so the parent event routinely lands on the existing-node branch where agent was previously dropped -- leaving :Session.agent empty and undercounting WHERE s.agent = ... queries. IncompleteSession heal-forward: a stale IncompleteSession marker (stamped when a session:end drained before its session:start/fork) is stripped the moment the real start/fork is processed, leaving only the correct terminal label. classify() routes every start/fork transition through _heal_forward. Tests: heal-forward unit matrix + neo4j race; working_dir non-overwrite unit + neo4j race; agent non-overwrite unit + neo4j race. Version 7.1.0. 🤖 Generated with [Amplifier](https://github.com/microsoft/amplifier) Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
Diego Colombo (colombod)
force-pushed
the
feat/session-node-data-quality
branch
from
August 26, 2026 17:06
44360b6 to
a0c8333
Compare
Diego Colombo (colombod)
marked this pull request as draft
August 27, 2026 15:30
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Second of the progressive split of #79 into smaller, independently-reviewable PRs. Stacks on PR1 (#85, ingest correctness) → #81 (storage-protocol isolation) → #78.
Delivers
working_dirend-to-end: persisted on the Session node populate-if-missing (never overwrites an existing value), lifted from the event envelope throughpost_events, coalesced at the Neo4j MERGE, with a model field + validator.agentfield (folds in fix: persist agent name on sub-session nodes across a delivery-order race (v6.7.4) #83): populate-if-missing on the Session node, same non-overwrite pattern asworking_dir, adjacent inensure_session_node.session:start/session:forkarriving after events heals the placeholder forward instead of leaving anIncompleteSession.Scope
queue_manager/*orregistry.py.Surface
Verification
/version→ 7.1.0, a sample event'sworking_dir+agentpersist on the Session node).