Skip to content

docs + refactor: fix audit inconsistencies, decouple product from research packages#26

Merged
simonovic86 merged 5 commits intomainfrom
claude/peaceful-volhard
Mar 14, 2026
Merged

docs + refactor: fix audit inconsistencies, decouple product from research packages#26
simonovic86 merged 5 commits intomainfrom
claude/peaceful-volhard

Conversation

@simonovic86
Copy link
Owner

@simonovic86 simonovic86 commented Mar 14, 2026

Summary

Documentation fixes

  • Fix tick timeout references (100ms → 15s) across architecture, lifecycle, and enforcement docs
  • Fix resume CLI syntax in CLAUDE.md
  • Add HTTP hostcall documentation to HOSTCALL_ABI.md
  • Update IMPLEMENTATION_STATUS.md with igord-lab attribution, HTTP/effects/pricewatcher/sentinel rows
  • Update ROADMAP.md Phase 2 scope and success metrics

Refactoring: decouple product from research packages

  • Break transitive dependency chain: igord no longer pulls in authority or config packages
  • Extract DefaultTickTimeout into internal/agent, EpochData struct replaces authority.Epoch in checkpoint headers, Instance.Lease becomes any with LeaseInfo interface
  • Extract duplicated loadOrGenerateIdentity into pkg/identity/loader.go
  • Move research agents (example, reconciliation) under agents/research/; relocate cmd/demo-reconciliation into agents/research/reconciliation/cmd/demo/

Test plan

  • go build ./... — clean compilation
  • go test ./... — all 28 packages pass
  • go list -deps ./cmd/igord/ | grep -E 'authority|config' — returns nothing
  • Pre-commit hooks pass (fmt, vet, lint, test)

🤖 Generated with Claude Code

simonovic86 and others added 2 commits March 14, 2026 22:50
The effect model makes crash-safe side effects a runtime primitive.
IntentState machine: Recorded → InFlight → Confirmed, with the "resume
rule" (InFlight → Unresolved on Unmarshal) for safe crash recovery.
Treasury sentinel agent demonstrates the pattern end-to-end.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix tick timeout 100ms → 15s across 4 files (matches config.TickTimeout)
- Fix igord resume CLI syntax (positional → --checkpoint/--wasm flags)
- Add HTTP hostcall documentation to HOSTCALL_ABI.md
- Fix IMPLEMENTATION_STATUS.md: flag attribution (igord-lab not igord),
  add HTTP/effects/pricewatcher/sentinel entries, fix stale claims
- Update ROADMAP.md Phase 2 with completed items and current status
- Fix stale phase references and lease version (v0x03 → v0x04)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7a85fbc14d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

igor.Logf("[sentinel] Intent RECORDED: refill $%d.%02d (key=%x...)",
refillAmount/100, refillAmount%100, key[:4])
igor.Logf("[sentinel] Waiting for checkpoint before execution...")
return true // request fast tick so we proceed quickly

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Wait for a durable checkpoint before executing refill

recordRefillIntent asks for a fast follow-up tick (return true), but in cmd/igord/main.go the fast interval is 10ms while checkpoints are only persisted every 5s; this means executeRefill will usually run before any checkpoint captures the newly Recorded intent. If the process crashes during that execution window, resume can roll back to a checkpoint that never contained the intent, so the transfer cannot become Unresolved and may be retried/omitted incorrectly.

Useful? React with 👍 / 👎.

Comment on lines +199 to +200
state := IntentState(d.data[d.pos])
d.pos++

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Guard state-byte read in effect log unmarshal

EffectLog.Unmarshal reads d.data[d.pos] directly without checking bounds, so a truncated effect-log payload with count > 0 but no remaining state byte will panic with an index-out-of-range during resume. This bypasses the decoder's normal short-read error path and can crash recovery instead of failing gracefully.

Useful? React with 👍 / 👎.

Break the transitive dependency chain that pulled authority and config
packages into the product igord binary:

- Extract DefaultTickTimeout (15s) into internal/agent, replacing
  config.TickTimeout usage in the product path
- Define EpochData struct in internal/agent to replace authority.Epoch
  in checkpoint headers; Instance.Lease becomes `any` with LeaseInfo
  interface for checkpoint building
- Extract duplicated loadOrGenerateIdentity into pkg/identity/loader.go
  with a minimal Store interface
- Move research agents (example, reconciliation) under agents/research/
- Move cmd/demo-reconciliation into agents/research/reconciliation/cmd/demo/
- Update Makefile, CLAUDE.md, and all doc references for new paths

Verified: `go list -deps ./cmd/igord/ | grep -E 'authority|config'`
returns nothing — product binary is fully decoupled.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@simonovic86 simonovic86 changed the title feat(sdk): effect lifecycle model, sentinel agent, and doc audit fixes docs + refactor: fix audit inconsistencies, decouple product from research packages Mar 14, 2026
simonovic86 and others added 2 commits March 14, 2026 23:17
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…al bounds check

- Sentinel: return false (standard 1s tick) after recording a refill
  intent so the runtime persists a checkpoint before executeRefill runs.
  Previously returned true (10ms fast tick), risking intent loss on crash.
- EffectLog.Unmarshal: add bounds check before reading state byte to
  prevent panic on truncated effect-log payloads during resume.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@simonovic86 simonovic86 merged commit 0a64d58 into main Mar 14, 2026
1 check passed
@simonovic86 simonovic86 deleted the claude/peaceful-volhard branch March 14, 2026 22:23
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