Skip to content

docs: parent_id auto-discovery — executable lookup before save#8

Merged
rmichaelthomas merged 1 commit into
mainfrom
feat/parent-id-auto-discovery
May 23, 2026
Merged

docs: parent_id auto-discovery — executable lookup before save#8
rmichaelthomas merged 1 commit into
mainfrom
feat/parent-id-auto-discovery

Conversation

@rmichaelthomas
Copy link
Copy Markdown
Owner

Fixes the gap observed live this session: an agent inheriting from a prior contract that was saved to Receipts still omitted parent_id, because the "Inheritance and lineage" section (PR #7) documented what and when but not how to find it. The lineage feature shipped dead — API supports it, frontend renders it, but the skill never performed the lookup.

Changes

  • Replaces the passive "how to obtain the parent ID" bullet list with an executable discovery procedure: query GET /api/v1/export, parse the contract history, match the prior contract by label or recency, and use its ID as parent_id. Includes a fallback to save the prior contract first (capturing its returned ID) if it was never saved. Tier 1 fallback (extract ID from a known permalink) preserved.
  • Adds a "resolve parent_id before saving" preamble to the session-end save step (step 2), cross-referencing the discovery procedure and stating that skipping it breaks the lineage chain.
  • Broadens the documented classifier allow rule from …/save only to "Bash(curl -s * https://receipts.liminate.dev/* *)" so the new GET /api/v1/export call works in auto-mode (failure mode feat: session pack v1 — 3 nouns, 2 verbs (cite, verify) #1). Tightly-scoped two-rule alternative noted.

Invariants

  • Discovery and save procedures cross-reference each other; neither assumes the other was read.
  • Export call uses $RECEIPTS_API_KEY — no new credentials.
  • Discovery is best-effort, not blocking: if export fails or returns nothing, the agent omits parent_id and saves anyway.
  • One file changed (SKILL.md).

🤖 Generated with Claude Code

Replaces the passive "how to obtain the parent ID" bullet list with an
executable discovery procedure: query GET /api/v1/export, match the
prior contract by label or recency, and use its ID as parent_id. Adds a
"resolve parent_id before saving" preamble to the session-end save step,
cross-referencing the discovery procedure. Broadens the documented
classifier allow rule to cover both /save and /api/v1/export so the
lookup works in auto-mode. SKILL.md documentation only.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@rmichaelthomas rmichaelthomas merged commit 4d87e38 into main May 23, 2026
2 checks passed
@rmichaelthomas rmichaelthomas deleted the feat/parent-id-auto-discovery branch May 23, 2026 16:59
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