Skip to content

feat(sdk): complete Task 8 — mocks, simulator, inspector#5

Merged
simonovic86 merged 1 commit intomainfrom
claude/vigilant-hoover
Mar 3, 2026
Merged

feat(sdk): complete Task 8 — mocks, simulator, inspector#5
simonovic86 merged 1 commit intomainfrom
claude/vigilant-hoover

Conversation

@simonovic86
Copy link
Copy Markdown
Owner

Summary

  • Capability mocks (sdk/igor/mock/): pluggable MockBackend for native go test without WASM compilation, with deterministic clock/rand and log capture. Hostcall wrappers split into build-tagged files (WASM vs native).
  • Local simulator (internal/simulator/): single-process WASM runner with deterministic hostcalls, per-tick replay verification, and checkpoint round-trip verification. New CLI flags: --simulate, --ticks, --verify, --deterministic, --seed.
  • Checkpoint inspector (internal/inspector/): parse and display checkpoint files with hex dump and WASM hash verification. New CLI flags: --inspect-checkpoint, --inspect-wasm.
  • Docs updated: ROADMAP.md, IMPLEMENTATION_STATUS.md, README.md reflect Task 8 completion.

This completes all Task 8 (Agent SDK & Developer Experience) deliverables.

Test plan

  • go test ./sdk/igor/mock/... — 12 mock tests pass (no TinyGo needed)
  • go test ./internal/inspector/... — 8 inspector tests pass (no TinyGo needed)
  • go test ./internal/simulator/... — 5 simulator integration tests pass (TinyGo required, skipped if absent)
  • make check — full fmt + vet + lint + test suite passes (verified by pre-commit hook)

🤖 Generated with Claude Code

…point inspector

Implement the three remaining Task 8 deliverables:

- Capability mocks (sdk/igor/mock/): pluggable MockBackend for native
  testing without WASM, deterministic clock/rand, log capture. Split
  hostcall wrappers into build-tagged files (WASM vs native).
- Local simulator (internal/simulator/): single-process WASM runner with
  deterministic hostcalls, per-tick replay verification, checkpoint
  round-trip verification. CLI flags: --simulate, --ticks, --verify,
  --deterministic, --seed.
- Checkpoint inspector (internal/inspector/): parse and display checkpoint
  files with hex dump, WASM hash verification. CLI flags:
  --inspect-checkpoint, --inspect-wasm.

Update docs: ROADMAP.md, IMPLEMENTATION_STATUS.md, README.md to reflect
Task 8 completion.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@simonovic86 simonovic86 merged commit 818a7fc into main Mar 3, 2026
1 check passed
@simonovic86 simonovic86 deleted the claude/vigilant-hoover branch March 3, 2026 08:08
Copy link
Copy Markdown

@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: 669b7abe7f

ℹ️ 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".

func loadManifest(cfg Config) []byte {
mPath := cfg.ManifestPath
if mPath == "" && cfg.WASMPath != "" {
mPath = cfg.WASMPath[:len(cfg.WASMPath)-len(".wasm")] + ".manifest.json"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Validate .wasm suffix before deriving manifest path

When ManifestPath is empty, this code slices cfg.WASMPath by len(".wasm") without checking that the input is long enough or actually ends with .wasm. A simulator run with a nonstandard filename (for example agent or any short path) can panic with an out-of-range slice, and other non-.wasm names derive an incorrect manifest path, causing confusing fallback behavior instead of a normal validation error.

Useful? React with 👍 / 👎.

Comment thread cmd/igord/main.go
Comment on lines +55 to +56
if *simulate && *runAgent != "" {
runSimulator(*runAgent, *manifestPath, *budgetFlag, *simTicks, *simVerify, *simDeterministic, *simSeed)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Fail fast when --simulate is missing --run-agent

The simulator mode is only entered when both flags are set, so --simulate by itself is silently ignored and execution falls through to normal node startup. In CLI automation this can unexpectedly start the full daemon/P2P flow and hang instead of immediately telling the user that --run-agent is required for simulation.

Useful? React with 👍 / 👎.

simonovic86 added a commit that referenced this pull request Mar 4, 2026
Implements the remaining optimization items from IMPROVEMENTS.md:

- #9 Arena-backed event log allocation to reduce GC pressure
- #3 Observation-weighted snapshot retention (replaces FIFO eviction)
- #5 Configurable replay divergence escalation (log/pause/intensify/migrate)
- #4 Multi-tick chain replay verification (N ticks in single wazero instance)
- #7 SDK checkpoint serialization helpers (Encoder/Decoder with chainable API)
- #6 Adaptive tick rate with agent hint (Tick() returns bool, 10ms/1s intervals)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
simonovic86 added a commit that referenced this pull request Mar 4, 2026
Implements the remaining optimization items from IMPROVEMENTS.md:

- #9 Arena-backed event log allocation to reduce GC pressure
- #3 Observation-weighted snapshot retention (replaces FIFO eviction)
- #5 Configurable replay divergence escalation (log/pause/intensify/migrate)
- #4 Multi-tick chain replay verification (N ticks in single wazero instance)
- #7 SDK checkpoint serialization helpers (Encoder/Decoder with chainable API)
- #6 Adaptive tick rate with agent hint (Tick() returns bool, 10ms/1s intervals)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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