Skip to content

dld-goal: run state, event log, and contract schema - #30

Closed
jimutt wants to merge 4 commits into
feat/dld-goalfrom
feat/dld-goal-state
Closed

dld-goal: run state, event log, and contract schema#30
jimutt wants to merge 4 commits into
feat/dld-goalfrom
feat/dld-goal-state

Conversation

@jimutt

@jimutt jimutt commented Aug 21, 2026

Copy link
Copy Markdown
Owner

Stacks on #29. Implements DL-001.

What

The durable state layer for goal runs, under .dld/runs/<slug>/: contract.md (immutable objective), state.json (atomic writes, camelCase), events.jsonl (append-only).

New scripts: create-run.sh, run-state.sh, append-event.sh. common.sh gains config_get_optional, get_runs_dir, get_run_dir, require_jq, validate_slug, utc_timestamp.

docs/framework/run-contract.md specifies the format normatively, so the bash scripts and the future Pi extension cannot drift.

Notable

  • New dependency: jq, scoped to dld-goal and declared in its compatibility frontmatter. The item schema is genuinely nested and hand-parsing it in bash is where correctness bugs live.
  • Run artifacts are gitignored by default — decisions are the permanent record, runs are working state. Opt out with goal_run_artifacts: commit.
  • SKILL.md lands here rather than in the final slice: the suite requires every skills/dld-*/ dir to be registered in plugin.json and to carry a SKILL.md, so the skill file grows across the stack.

39 new tests.

jimutt and others added 4 commits August 21, 2026 13:47
Adds the durable state layer for goal runs (DL-001):

- create-run.sh scaffolds .dld/runs/<slug>/ with contract.md, state.json
  and events.jsonl, and gitignores run artifacts unless the project sets
  goal_run_artifacts: commit
- run-state.sh reads and mutates state atomically (temp file + rename),
  refreshing updatedAt on every write
- append-event.sh appends one compact JSON object per event
- common.sh gains config_get_optional, get_runs_dir, get_run_dir,
  require_jq, validate_slug and utc_timestamp

Schema is specified in docs/framework/run-contract.md so the bash scripts
and the future Pi extension cannot drift. 39 new tests, suite at 218.

Co-Authored-By: Claude Opus 5 <noreply@pi.dev>
Generated-By: pi 0.84.2
/dld-goal start now presents how the decisions group into items, why
each batch exists, and the ordering, and iterates until the user agrees
before the contract is written. The agreed slicing is recorded in the
contract body, which is immutable for the life of the run.

Adds the AskUserQuestion interaction-style section other interactive
skills carry.

Co-Authored-By: Claude Opus 5 <noreply@pi.dev>
Generated-By: pi 0.84.2
Bounds are now derived from the agreed slicing and offered as a
recommendation: max items equals the planned item count, max minutes
defaults to roughly 20 per decision in scope, adjusted for how
wide-reaching the decisions are.

Co-Authored-By: Claude Opus 5 <noreply@pi.dev>
Generated-By: pi 0.84.2
Per-decision, not per-item, and the example now shows the
multiplication so the two counts cannot be confused.

Co-Authored-By: Claude Opus 5 <noreply@pi.dev>
Generated-By: pi 0.84.2
@jimutt
jimutt force-pushed the feat/dld-goal-state branch from 6f90806 to 3362119 Compare August 21, 2026 11:49
@jimutt

jimutt commented Aug 25, 2026

Copy link
Copy Markdown
Owner Author

Superseded by feat/pi-harness-extension — all commits from this branch are merged there. See #41 for the findings log on top.

@jimutt jimutt closed this Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant