Skip to content

feat: implement boot loop - #104

Merged
couragehong merged 3 commits into
CryptoLabInc:feat/go-migrationfrom
esifea:feat/esifea/boot-loop
May 7, 2026
Merged

couragehong merged 3 commits into
CryptoLabInc:feat/go-migrationfrom
esifea:feat/esifea/boot-loop

Conversation

@esifea

@esifea esifea commented May 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • What changed:
  • Why:
  • Scope:

Validation

  • Tests run (or explain why not):
  • Docs updated (if behavior/setup changed)

Cross-Agent Invariants

  • scripts/bootstrap-mcp.sh remains the single source of truth for runtime prep (venv/deps/self-heal)
  • No agent-specific script duplicates bootstrap/setup logic
  • Agent-specific scripts remain thin adapters (registration/wiring only)
  • Codex-only commands (codex mcp ...) are clearly separated from cross-agent/common instructions
  • Claude/Gemini/OpenAI instructions do not include Codex-only commands
  • SKILL.md, commands/rune/*.toml, and AGENT_INTEGRATION.md stay consistent on boundaries

Notes for Reviewers

  • Risk areas:
  • Backward compatibility impact:
  • Follow-up work (if any):

@esifea
esifea marked this pull request as ready for review May 7, 2026 01:45
@esifea
esifea requested a review from couragehong May 7, 2026 01:45
couragehong added a commit that referenced this pull request May 7, 2026
…ctor config

Rewrites the boot loop to address five integration bugs in #104's first
draft, plus a handful of hygiene fixes.

Critical:
1. envector.ClientConfig.KeyDim is now set (DefaultKeyDim=1024 const matching
   Qwen3-Embedding-0.6B per spec). Without it, OpenKeysFromFile().validate()
   rejects the call with 'WithKeyDim required'.
2. envector.ClientConfig.KeyPath now points to the per-key directory
   (~/.rune/keys/<keyID>/) via keymanager.KeyDir, not its parent. envector
   resolves EncKey.json directly under WithKeyPath.
3. embedder.New now uses embedder.ResolveSocketPath("") instead of a TODO
   empty-string placeholder.
4. After Vault.GetAgentManifest, deps.ApplyVaultBundle(bundle) propagates
   AgentID / AgentDEK / IndexName / KeyID to the service structs (formerly
   missing → capture's AES envelope would seal with empty DEK).
5. keymanager.SaveEncKey replaces SaveKeys (matching the rename).

Hygiene:
- bootOnce helper isolates one boot attempt so partial-success cleanup
  becomes uniform: any failure after a NewClient succeeds closes the
  partial conns (vault/embedder/envector) before retrying. No more gRPC
  conn leak on retry.
- RunBootLoop runs ctx.Err() at the top of each iteration so SIGTERM
  during sleep stops cleanly.
- empty-config / config-load failures now record into m.lastError so
  diagnostics surfaces the cause; attempt counter increments uniformly.
- 'persistent failure' log fires every 20 attempts based on
  attempts (was checked inline only on Vault path).
- Added Manager.LastError() public reader for diagnostics tools.
- BootAdapterInjector gains ApplyVaultBundle method for the metadata
  propagation step.

Spec note (open follow-up): RunBootLoop returns on first Active. Re-init
after dormant↔active transitions is the responsibility of
service.LifecycleService.ReloadPipelines (which spawns a fresh
RunBootLoop goroutine) — the boot loop itself does not loop forever after
success, contrary to a literal reading of rune-mcp.md §부팅 시퀀스. Will
revisit if reload behavior turns out wrong.
@couragehong couragehong closed this May 7, 2026
@couragehong couragehong reopened this May 7, 2026
@couragehong
couragehong merged commit e4c7c2e into CryptoLabInc:feat/go-migration May 7, 2026
2 checks passed
couragehong added a commit that referenced this pull request May 7, 2026
…fixes

feat(boot): end-to-end boot loop — super-set of #104
heeyeon01 pushed a commit to heeyeon01/rune that referenced this pull request Jul 7, 2026
…ctor config

Rewrites the boot loop to address five integration bugs in CryptoLabInc#104's first
draft, plus a handful of hygiene fixes.

Critical:
1. envector.ClientConfig.KeyDim is now set (DefaultKeyDim=1024 const matching
   Qwen3-Embedding-0.6B per spec). Without it, OpenKeysFromFile().validate()
   rejects the call with 'WithKeyDim required'.
2. envector.ClientConfig.KeyPath now points to the per-key directory
   (~/.rune/keys/<keyID>/) via keymanager.KeyDir, not its parent. envector
   resolves EncKey.json directly under WithKeyPath.
3. embedder.New now uses embedder.ResolveSocketPath("") instead of a TODO
   empty-string placeholder.
4. After Vault.GetAgentManifest, deps.ApplyVaultBundle(bundle) propagates
   AgentID / AgentDEK / IndexName / KeyID to the service structs (formerly
   missing → capture's AES envelope would seal with empty DEK).
5. keymanager.SaveEncKey replaces SaveKeys (matching the rename).

Hygiene:
- bootOnce helper isolates one boot attempt so partial-success cleanup
  becomes uniform: any failure after a NewClient succeeds closes the
  partial conns (vault/embedder/envector) before retrying. No more gRPC
  conn leak on retry.
- RunBootLoop runs ctx.Err() at the top of each iteration so SIGTERM
  during sleep stops cleanly.
- empty-config / config-load failures now record into m.lastError so
  diagnostics surfaces the cause; attempt counter increments uniformly.
- 'persistent failure' log fires every 20 attempts based on
  attempts (was checked inline only on Vault path).
- Added Manager.LastError() public reader for diagnostics tools.
- BootAdapterInjector gains ApplyVaultBundle method for the metadata
  propagation step.

Spec note (open follow-up): RunBootLoop returns on first Active. Re-init
after dormant↔active transitions is the responsibility of
service.LifecycleService.ReloadPipelines (which spawns a fresh
RunBootLoop goroutine) — the boot loop itself does not loop forever after
success, contrary to a literal reading of rune-mcp.md §부팅 시퀀스. Will
revisit if reload behavior turns out wrong.
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.

2 participants