chore: replace 607 em-dashes with double hyphens project-wide
Includes MCP crash-after-init test fix (crash moved from handle() to serve() entry point so transport sees immediate subprocess death).
This commit is contained in:
1 parent
16d6cd62b7
commit
f6d51416f0
112 files changed
+587
-582
No files matched your search
@@ -2,7 +2,7 @@
|
||||
|
||||
**Author:** Archie (Hermes agent)
|
||||
**Date:** 2026-07-21 (implementation status updated 2026-07-22)
|
||||
**Status:** Final (substantially implemented — remaining aspirational items are pluggable storage backends and Layer 2 daemon plugin loader)
|
||||
**Status:** Final (substantially implemented -- remaining aspirational items are pluggable storage backends and Layer 2 daemon plugin loader)
|
||||
|
||||
---
|
||||
|
||||
@@ -19,9 +19,9 @@ This document describes a target end state. The table below is the ground truth;
|
||||
| `/data/` volume, `task.json` | **Partial** | `container.WriteTaskJSON()` writes task payload to the worktree before container acquire. The container pool bind-mounts the isolated task worktree at `/data/worktree`; configured repos also receive a persistent `/data/repo` Docker volume. Task payload travels over NATS as the primary channel; `/data/task.json` is a boot-time brief for the container. |
|
||||
| `[containers]` config block | **Implemented** | `ContainerConfig` struct in config.go: enabled, image, max_concurrency, max_uptime, pull_policy. Validated on load. |
|
||||
| Yaegi extensibility (gates, custom stages, skill scripts) | **Implemented** | Three surfaces: `.archie/gate.go`, `.archie/stages/*.go`, skill scripts via `run_go_script` tool. All in-process via Yaegi with generated symbol tables and panic recovery. Full detail in `docs/prds/yaegi-plugin-system.md`. |
|
||||
| Layer 1: skill-bundled plugins | **Implemented** | `skill.DiscoverPlugins()` scans `.agents/skills/<name>/plugins/*.go`. `skill.Plugin.Run()` executes them via Yaegi. `skillbuild.BuildWorkflow()` constructs `workflow.Workflow` from plugin-defined stages. `TaskContext.SkillPlugins` makes them available during stage execution. `skillbuild.BuildRegistry()` replaces the hardcoded `workflow.Registry` with catalog-driven construction — skills define workflows, plugins define stages. |
|
||||
| Layer 2: core daemon plugins | **Partial** | `internal/plugin/plugin.go`: `Plugin` interface (`Name()`, `Version()`), `Registry` type, `LoadDir()` using Yaegi to interpret `.go` files. No `~/.config/archie/plugins/` loader wired into `cmd/archied/main.go` yet — the interface and registry exist but are not connected to the daemon's startup. |
|
||||
| Skills (agentskills.io spec) | **Implemented** | `internal/skill/skill.go`: parses SKILL.md YAML frontmatter, discovers skills from `.agents/skills/*/SKILL.md`, extracts body. Skills follow `archie-wf-*` naming convention. Progressive disclosure: `Catalog()` (Tier 1 — frontmatter-only scan, ~100 tokens per entry), `LoadBody()` (Tier 2 — full body on activation), `Discover()` (Tier 3 — full parse with plugins). `metadata.archie.workflow` declares skill→workflow affinity. `skill.SkillForWorkflow()` is catalog-driven, no hardcoded maps. `skillbuild.BuildRegistry()` constructs the daemon's workflow registry from the catalog. |
|
||||
| Layer 1: skill-bundled plugins | **Implemented** | `skill.DiscoverPlugins()` scans `.agents/skills/<name>/plugins/*.go`. `skill.Plugin.Run()` executes them via Yaegi. `skillbuild.BuildWorkflow()` constructs `workflow.Workflow` from plugin-defined stages. `TaskContext.SkillPlugins` makes them available during stage execution. `skillbuild.BuildRegistry()` replaces the hardcoded `workflow.Registry` with catalog-driven construction -- skills define workflows, plugins define stages. |
|
||||
| Layer 2: core daemon plugins | **Partial** | `internal/plugin/plugin.go`: `Plugin` interface (`Name()`, `Version()`), `Registry` type, `LoadDir()` using Yaegi to interpret `.go` files. No `~/.config/archie/plugins/` loader wired into `cmd/archied/main.go` yet -- the interface and registry exist but are not connected to the daemon's startup. |
|
||||
| Skills (agentskills.io spec) | **Implemented** | `internal/skill/skill.go`: parses SKILL.md YAML frontmatter, discovers skills from `.agents/skills/*/SKILL.md`, extracts body. Skills follow `archie-wf-*` naming convention. Progressive disclosure: `Catalog()` (Tier 1 -- frontmatter-only scan, ~100 tokens per entry), `LoadBody()` (Tier 2 -- full body on activation), `Discover()` (Tier 3 -- full parse with plugins). `metadata.archie.workflow` declares skill→workflow affinity. `skill.SkillForWorkflow()` is catalog-driven, no hardcoded maps. `skillbuild.BuildRegistry()` constructs the daemon's workflow registry from the catalog. |
|
||||
| Worktree/repo management | **Implemented** | Each issue keeps an isolated worktree. Repos with `persistent_storage = true` use a per-repo bare Git object cache to avoid repeated full network clones; caches and Archie-owned repo volumes expire via `containers.volume_ttl`. |
|
||||
| Config schema | **Closer to sec.4** | `[agent]` block: mode (inprocess/subprocess/nats) + command + env. `[nats]` block: url + token_env. `[containers]` block: enabled, image, max_concurrency, max_uptime, volume_ttl, pull_policy. Per-repo `persistent_storage` is supported as a boolean Docker-volume/Git-cache opt-in. |
|
||||
|
||||
|
||||
@@ -36,9 +36,9 @@ Hermes gateway (`gateway/run.py`, GatewayRunner) manages full lifecycle: adapter
|
||||
|
||||
| Feature | archie-core status | Priority |
|
||||
|---|---|---|
|
||||
| Adapter lifecycle (connect/disconnect/reconnect) | None — 3-method Gateway interface | **P0** |
|
||||
| MessageEvent data model (types, media, reply context) | None — 3-field Message struct | **P0** |
|
||||
| SendResult with retry/error classification | None — fire-and-forget | **P1** |
|
||||
| Adapter lifecycle (connect/disconnect/reconnect) | None -- 3-method Gateway interface | **P0** |
|
||||
| MessageEvent data model (types, media, reply context) | None -- 3-field Message struct | **P0** |
|
||||
| SendResult with retry/error classification | None -- fire-and-forget | **P1** |
|
||||
| Session management (SessionSource + AsyncSessionStore) | None | **P0** |
|
||||
| Platform config (Platform enum, PlatformConfig) | None | **P0** |
|
||||
| Streaming delivery (token streaming with edit/draft) | None | **P1** |
|
||||
@@ -54,7 +54,7 @@ Hermes has 30+ platform adapters: Telegram, Discord, Slack, Matrix, WhatsApp, Si
|
||||
|
||||
| Feature | archie-core status | Priority |
|
||||
|---|---|---|
|
||||
| BasePlatformAdapter ABC (20+ methods, capability flags) | None — 3-method Gateway interface | **P0** |
|
||||
| BasePlatformAdapter ABC (20+ methods, capability flags) | None -- 3-method Gateway interface | **P0** |
|
||||
| Platform adapter registry + plugin discovery | None | **P0** |
|
||||
| Media handling (image/video/audio/document send) | None | **P1** |
|
||||
| Typing indicators | None | **P2** |
|
||||
@@ -110,7 +110,7 @@ Hermes has: 60+ CLI commands, TUI interface, command registry with plugin contri
|
||||
|
||||
| Feature | archie-core status | Priority |
|
||||
|---|---|---|
|
||||
| Interactive CLI with command registry | None — 4 flags | **P1** |
|
||||
| Interactive CLI with command registry | None -- 4 flags | **P1** |
|
||||
| Config subcommands (get/set/unset/edit/wizard) | None | **P1** |
|
||||
| .env file support | None | **P2** |
|
||||
| Self-update mechanism | None | **P2** |
|
||||
@@ -171,10 +171,10 @@ Hermes has: FastAPI web server (Vite/React frontend), OpenAI-compatible API serv
|
||||
|
||||
## Total: ~60 feature gaps across 11 subsystems
|
||||
|
||||
**P0 (must-have for baseline parity):** 7 items — adapter lifecycle, message model, session management, platform config, tool registry, MCP client, memory provider ABC
|
||||
**P0 (must-have for baseline parity):** 7 items -- adapter lifecycle, message model, session management, platform config, tool registry, MCP client, memory provider ABC
|
||||
|
||||
**P1 (near-term):** 13 items — send result, streaming, dedup, media handling, guardrails, progressive disclosure, tool persistence, session hooks, history store, pairing/auth, CLI, config subcommands, profiles, readiness
|
||||
**P1 (near-term):** 13 items -- send result, streaming, dedup, media handling, guardrails, progressive disclosure, tool persistence, session hooks, history store, pairing/auth, CLI, config subcommands, profiles, readiness
|
||||
|
||||
**P2 (medium-term):** 22 items — interactive UX, subagents, browser/search/file tools, compression, session splitting, slash access, secrets CLI, cron, dashboard, API server, delivery, drain, scale-to-zero
|
||||
**P2 (medium-term):** 22 items -- interactive UX, subagents, browser/search/file tools, compression, session splitting, slash access, secrets CLI, cron, dashboard, API server, delivery, drain, scale-to-zero
|
||||
|
||||
**P3 (future):** 3 items — billing, OAuth, desktop app
|
||||
**P3 (future):** 3 items -- billing, OAuth, desktop app
|
||||
@@ -161,7 +161,7 @@ pieces where isolation adds cost without benefit:
|
||||
Decision rationale: per-identity goroutines guarantee failure isolation (one
|
||||
identity's forge outage cannot block another's poll tick), each identity
|
||||
gets its own forge rate-limit domain, and the existing `Daemon` struct maps
|
||||
cleanly — each goroutine holds a thin `Identity` value (forge client + config
|
||||
cleanly -- each goroutine holds a thin `Identity` value (forge client + config
|
||||
subset + worktree manager + NATS subject prefix) and dispatches tasks with
|
||||
an `identity_name` column on the task row. The shared NATS connection
|
||||
multiplexes subjects by identity prefix; the shared store already handles
|
||||
@@ -170,7 +170,7 @@ the identity name so agent containers (which consume from NATS) route
|
||||
responses back to the correct daemon identity.
|
||||
|
||||
This design resolves the open question in section 4 of the original PRD
|
||||
draft (per-identity goroutine vs single loop iterating identities — the
|
||||
draft (per-identity goroutine vs single loop iterating identities -- the
|
||||
former, for failure isolation).
|
||||
|
||||
## 5. Priority / phasing
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# archie-core TypeScript Plugin Engine — PRD
|
||||
# archie-core TypeScript Plugin Engine -- PRD
|
||||
|
||||
**Author:** Archie (Hermes agent)
|
||||
**Date:** 2026-07-21
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
## Summary
|
||||
|
||||
A TypeScript-based plugin engine that lets repositories ship interpreted, dynamically-loaded workflow extensions. Plugins are `.ts` files placed in `.archie/workflows/`. archie-core discovers them on its next poll cycle, transpiles them to JavaScript via esbuild, and executes them in an embedded [goja](https://github.com/dop251/goja) runtime — a pure-Go ECMAScript interpreter with zero CGO dependencies.
|
||||
A TypeScript-based plugin engine that lets repositories ship interpreted, dynamically-loaded workflow extensions. Plugins are `.ts` files placed in `.archie/workflows/`. archie-core discovers them on its next poll cycle, transpiles them to JavaScript via esbuild, and executes them in an embedded [goja](https://github.com/dop251/goja) runtime -- a pure-Go ECMAScript interpreter with zero CGO dependencies.
|
||||
|
||||
---
|
||||
|
||||
@@ -20,7 +20,7 @@ TypeScript is the most widely understood language among developers writing autom
|
||||
|
||||
Having a TypeScript-native plugin engine means:
|
||||
- Plugin authors get familiar syntax, type safety, and IDE support
|
||||
- No separate toolchain — just `.ts` files in a folder
|
||||
- No separate toolchain -- just `.ts` files in a folder
|
||||
- Skills, gates, and workflow stages share the same language
|
||||
|
||||
### Why goja
|
||||
@@ -29,12 +29,12 @@ Having a TypeScript-native plugin engine means:
|
||||
|---|---|
|
||||
| V8 CGO bindings | Requires CGO, ~50MB static libraries, platform-specific builds |
|
||||
| QuickJS CGO | Requires CGO, smaller than V8 but still a C dependency |
|
||||
| QJS (Wazero) | Pure Go WASM, but sandboxed — can't expose Go functions efficiently |
|
||||
| QJS (Wazero) | Pure Go WASM, but sandboxed -- can't expose Go functions efficiently |
|
||||
| Ramune | Heavy dependency, bundles an entire TypeScript 7 compiler |
|
||||
| Node.js subprocess | Process overhead per execution, IPC serialization cost |
|
||||
|
||||
goja is a pure-Go ECMAScript 5.1+ interpreter at ~20k lines. It:
|
||||
- Has **zero CGO** — cross-compiles everywhere Go does
|
||||
- Has **zero CGO** -- cross-compiles everywhere Go does
|
||||
- Passes nearly all TC39 Test262 tests for ES5.1 + significant ES6 coverage
|
||||
- Can run Babel and the TypeScript compiler itself (proven capability)
|
||||
- Provides direct Go↔JS interop via `Set()`/`Get()`/`Runtime.RunString()`
|
||||
@@ -114,7 +114,7 @@ export function check(ctx: GateContext): Finding[] {
|
||||
if (line.includes("panic(")) {
|
||||
findings.push({
|
||||
level: "error",
|
||||
message: "new panic() call — use error returns instead"
|
||||
message: "new panic() call -- use error returns instead"
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -128,7 +128,7 @@ export function check(ctx: GateContext): Finding[] {
|
||||
findings.push({
|
||||
level: "warn",
|
||||
file: file,
|
||||
message: "time.Sleep in non-test code — use time.Ticker instead"
|
||||
message: "time.Sleep in non-test code -- use time.Ticker instead"
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -217,7 +217,7 @@ All file operations are **jailed to the worktree**. `archie.readFile("/etc/passw
|
||||
|
||||
### Reload cycle
|
||||
|
||||
Plugins are loaded fresh on every poll cycle — archie-core already fresh-clones per task. No hot-reload complexity, no cache invalidation. The worktree is the source of truth.
|
||||
Plugins are loaded fresh on every poll cycle -- archie-core already fresh-clones per task. No hot-reload complexity, no cache invalidation. The worktree is the source of truth.
|
||||
|
||||
For the rare case where a plugin errors at parse/transpile time, archie-core comments on the issue with the diagnostic and parks the task. The plugin author fixes the `.ts` file and requeues.
|
||||
|
||||
@@ -294,7 +294,7 @@ func (l *Loader) LoadPlugins(worktreeDir string) ([]Plugin, error) {
|
||||
dir := filepath.Join(worktreeDir, ".archie", "workflows")
|
||||
entries, err := os.ReadDir(dir)
|
||||
if os.IsNotExist(err) {
|
||||
return nil, nil // no plugins — not an error
|
||||
return nil, nil // no plugins -- not an error
|
||||
}
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -388,7 +388,7 @@ goja natively supports ES5.1 with significant ES6 features. Modern syntax like `
|
||||
| Generators | ❌ not supported |
|
||||
| `Proxy` | ❌ not supported |
|
||||
|
||||
For gate scripts, this is fine — gates are synchronous by nature. If async is genuinely needed later, the Bun backend (via `tsgo`) is the escape hatch.
|
||||
For gate scripts, this is fine -- gates are synchronous by nature. If async is genuinely needed later, the Bun backend (via `tsgo`) is the escape hatch.
|
||||
|
||||
### Performance
|
||||
|
||||
@@ -417,7 +417,7 @@ Plugins can't `import` from npm or other files. They're self-contained modules.
|
||||
| **Plugin folder** | `.archie/workflows/` | `.archie/workflows/` |
|
||||
| **Best for** | Custom stages needing Go's stdlib, tight daemon integration | Custom gates and scripts where author familiarity matters |
|
||||
|
||||
**Recommendation: support both.** They solve different problems. Yaegi for repo owners who want full Go power in their custom stages. goja for repo owners who want to write gates and scripts in TypeScript. Both load from `.archie/workflows/` — archie-core discovers which engine to use by file extension (`.go` → Yaegi, `.ts` → goja+esbuild).
|
||||
**Recommendation: support both.** They solve different problems. Yaegi for repo owners who want full Go power in their custom stages. goja for repo owners who want to write gates and scripts in TypeScript. Both load from `.archie/workflows/` -- archie-core discovers which engine to use by file extension (`.go` → Yaegi, `.ts` → goja+esbuild).
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# archie-core Yaegi Plugin System — PRD
|
||||
# archie-core Yaegi Plugin System -- PRD
|
||||
|
||||
**Author:** Archie (Hermes agent)
|
||||
**Date:** 2026-07-21
|
||||
@@ -23,11 +23,11 @@ Embed the [Yaegi](https://github.com/traefik/yaegi) Go interpreter to let archie
|
||||
- "All public functions in `pkg/api/` must be documented"
|
||||
- "No `time.Sleep` in production code paths"
|
||||
|
||||
These are rules that need to read the diff, parse Go ASTs, or walk the worktree — things shell scripts can do but shouldn't have to.
|
||||
These are rules that need to read the diff, parse Go ASTs, or walk the worktree -- things shell scripts can do but shouldn't have to.
|
||||
|
||||
### Why not shell scripts?
|
||||
|
||||
Shell scripts for gates are fine until they're not. They can't import the archie-core types, can't use the Go parser, and are a second language to maintain alongside the daemon. Yaegi runs Go — the same language as the daemon, the same language as the repos archie-core works on.
|
||||
Shell scripts for gates are fine until they're not. They can't import the archie-core types, can't use the Go parser, and are a second language to maintain alongside the daemon. Yaegi runs Go -- the same language as the daemon, the same language as the repos archie-core works on.
|
||||
|
||||
### Why not Go's native `plugin` package?
|
||||
|
||||
@@ -37,7 +37,7 @@ Go's `plugin` package (`.so` files) requires:
|
||||
- No unload
|
||||
- Painful distribution
|
||||
|
||||
Yaegi interprets `.go` source files directly — no compilation step, portable everywhere, loads from filesystem paths.
|
||||
Yaegi interprets `.go` source files directly -- no compilation step, portable everywhere, loads from filesystem paths.
|
||||
|
||||
### Production precedent
|
||||
|
||||
@@ -52,7 +52,7 @@ Yaegi interprets `.go` source files directly — no compilation step, portable e
|
||||
|
||||
| Surface | Location | When loaded | What it does |
|
||||
|---|---|---|---|
|
||||
| **Custom gate functions** | `.archie/gate.go` | During the gate stage (after shell commands) | Returns `[]Finding` — each finding has severity, message, file, line |
|
||||
| **Custom gate functions** | `.archie/gate.go` | During the gate stage (after shell commands) | Returns `[]Finding` -- each finding has severity, message, file, line |
|
||||
| **Custom workflow stages** | `.archie/stages/<name>.go` | When the workflow references the stage name | Returns a `workflow.Stage` implementation |
|
||||
| **Skill scripts** | `.archie/skills/<skill>/scripts/*.go` | When the parent skill is activated | Called by the skill's instructions |
|
||||
|
||||
@@ -61,7 +61,7 @@ Yaegi interprets `.go` source files directly — no compilation step, portable e
|
||||
The most important extension surface. After the shell-based gate passes, archie-core loads and evaluates `.archie/gate.go` in the worktree directory. The script exposes a `Check` function:
|
||||
|
||||
```go
|
||||
// .archie/gate.go — per-repo gate rules interpreted at runtime
|
||||
// .archie/gate.go -- per-repo gate rules interpreted at runtime
|
||||
package gate
|
||||
|
||||
import (
|
||||
@@ -104,7 +104,7 @@ func Check(ctx GateContext) []Finding {
|
||||
if strings.Contains(line, "panic(") {
|
||||
findings = append(findings, Finding{
|
||||
Level: "error",
|
||||
Message: "new panic() call — use error returns instead",
|
||||
Message: "new panic() call -- use error returns instead",
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -124,7 +124,7 @@ func Check(ctx GateContext) []Finding {
|
||||
findings = append(findings, Finding{
|
||||
Level: "warn",
|
||||
File: f,
|
||||
Message: "time.Sleep in non-test code — use time.Ticker or context.WithTimeout instead",
|
||||
Message: "time.Sleep in non-test code -- use time.Ticker or context.WithTimeout instead",
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -205,7 +205,7 @@ Via `i.Use()`, the daemon pre-loads symbols that interpreted code can import:
|
||||
| `archie-core/internal/gate` | `GateContext`, `Finding`, `Block` |
|
||||
| `stdlib` | Full Go standard library (stdlib.Symbols) |
|
||||
|
||||
Generated with `yaegi extract` — same approach Traefik and Vikunja use. A `//go:generate yaegi extract ...` line in the source triggers symbol table generation during `go generate`.
|
||||
Generated with `yaegi extract` -- same approach Traefik and Vikunja use. A `//go:generate yaegi extract ...` line in the source triggers symbol table generation during `go generate`.
|
||||
|
||||
---
|
||||
|
||||
@@ -213,10 +213,10 @@ Generated with `yaegi extract` — same approach Traefik and Vikunja use. A `//g
|
||||
|
||||
From Yaegi's own docs:
|
||||
- **No assembly files** (`.s` not supported)
|
||||
- **No CGo** (can't call C code — the daemon is pure Go, so this doesn't matter)
|
||||
- **No compiler/linker directives** (no `//go:embed`, etc. — fine for gate scripts)
|
||||
- **Interfaces from pre-compiled code can't be added dynamically** — the daemon must pre-compile wrapper types for any interface interpreted code needs to implement
|
||||
- **Slower than compiled code** — gate scripts run once per commit, not in hot paths; negligible impact
|
||||
- **No CGo** (can't call C code -- the daemon is pure Go, so this doesn't matter)
|
||||
- **No compiler/linker directives** (no `//go:embed`, etc. -- fine for gate scripts)
|
||||
- **Interfaces from pre-compiled code can't be added dynamically** -- the daemon must pre-compile wrapper types for any interface interpreted code needs to implement
|
||||
- **Slower than compiled code** -- gate scripts run once per commit, not in hot paths; negligible impact
|
||||
|
||||
The Vikunja PR documents a specific Yaegi quirk: **typed factory functions required.** You can't do `v.Interface().(MyInterface)` on a value returned from interpreted code. Each interface needs its own factory:
|
||||
|
||||
@@ -229,31 +229,31 @@ func NewReportable() Reportable { return &MyGate{} }
|
||||
|
||||
## Implementation phases
|
||||
|
||||
### Phase 1: Gate functions — implemented
|
||||
### Phase 1: Gate functions -- implemented
|
||||
- `yaegi` added as a dependency
|
||||
- Symbol table for `GateContext`, `Finding` generated via `yaegi extract` into `internal/gate/gateextract` (a separate package from `internal/gate` itself, avoiding the self-import cycle extracting a package's own symbols creates)
|
||||
- `internal/gate/gateeval.Evaluate`: loads `.archie/gate.go` from the worktree, interprets it, calls `Check()`; panics are recovered
|
||||
- Wired in as `workflow.StageYaegiGate`, run after the final commit in both the `implement` and `tdd` workflows
|
||||
- Error findings park the task; warn findings are logged only
|
||||
|
||||
### Phase 2: Custom stages — implemented
|
||||
### Phase 2: Custom stages -- implemented
|
||||
- Symbol table for `workflow.Stage`/`TaskContext`/`Outcome` generated into `internal/workflow/wfextract`
|
||||
- `internal/workflow/wfeval.Discover` scans `.archie/stages/*.go` in filename order and calls each file's exported `Stage()` function
|
||||
- `TaskContext.CustomStages` is an injected `func(dir string) ([]Stage, error)` — the composition root (`cmd/archied`) wires it to `wfeval.Discover`, keeping `internal/workflow` decoupled from its own generated symbol table
|
||||
- `TaskContext.CustomStages` is an injected `func(dir string) ([]Stage, error)` -- the composition root (`cmd/archied`) wires it to `wfeval.Discover`, keeping `internal/workflow` decoupled from its own generated symbol table
|
||||
- `workflow.StageRepoStages` runs discovered stages in order right after the worktree is prepared, in both `implement` and `tdd`
|
||||
- Simplification vs. the original sketch: stages are auto-discovered and always run (like `.archie/gate.go`) rather than referenced by name from `config.toml` — the workflow engine has no data-driven stage graph today, so wiring arbitrary named stages into arbitrary positions would need a larger config-driven rework. Auto-run-in-order covers the PRD's actual use case (a repo-defined pre-flight/setup hook) without it.
|
||||
- Simplification vs. the original sketch: stages are auto-discovered and always run (like `.archie/gate.go`) rather than referenced by name from `config.toml` -- the workflow engine has no data-driven stage graph today, so wiring arbitrary named stages into arbitrary positions would need a larger config-driven rework. Auto-run-in-order covers the PRD's actual use case (a repo-defined pre-flight/setup hook) without it.
|
||||
|
||||
### Phase 3: Skill scripts — implemented
|
||||
### Phase 3: Skill scripts -- implemented
|
||||
- `internal/skillscript.Run` interprets a `.go` file via `i.EvalPath`, which (like `go run`) evaluates and calls its `main()`; stdout/stderr are captured via `interp.Options`
|
||||
- Uses `stdlib.Symbols` + `stdlib/unrestricted.Symbols` (not just `stdlib`) — `os/exec` lives in the unrestricted set, and the PRD's own example script shells out via `os/exec`
|
||||
- No archie-core-specific symbol table needed here — skill scripts only touch the Go standard library
|
||||
- Uses `stdlib.Symbols` + `stdlib/unrestricted.Symbols` (not just `stdlib`) -- `os/exec` lives in the unrestricted set, and the PRD's own example script shells out via `os/exec`
|
||||
- No archie-core-specific symbol table needed here -- skill scripts only touch the Go standard library
|
||||
- Exposed to the agent loop as a new `run_go_script` tool (`internal/agentexec/inprocess.go`), available in every agent stage; path is validated to stay inside the workspace
|
||||
- This is how "the skill's instructions reference a script" cashes out concretely: the agent calls `run_go_script` with the path instead of needing a Go toolchain in the sandbox
|
||||
|
||||
### Phase 4: Hot reload — not needed, by construction
|
||||
- All three loaders (`gate.Evaluate`, `wfeval.Discover`, `skillscript.Run`) read their `.go` source from disk on every call — no in-memory cache exists anywhere in the implementation
|
||||
### Phase 4: Hot reload -- not needed, by construction
|
||||
- All three loaders (`gate.Evaluate`, `wfeval.Discover`, `skillscript.Run`) read their `.go` source from disk on every call -- no in-memory cache exists anywhere in the implementation
|
||||
- Every task additionally gets a fresh `git clone` (`worktree.Manager.Prepare` removes and re-clones the worktree directory per task)
|
||||
- Consequently every stage already re-reads `.archie/gate.go`, `.archie/stages/*.go`, and skill scripts fresh, every run — there is no stale state a file watcher would ever need to invalidate
|
||||
- Consequently every stage already re-reads `.archie/gate.go`, `.archie/stages/*.go`, and skill scripts fresh, every run -- there is no stale state a file watcher would ever need to invalidate
|
||||
- A file-watching daemon-runtime reload mechanism would add machinery with nothing to do given this architecture; revisit only if the daemon starts reusing long-lived worktrees across tasks
|
||||
|
||||
---
|
||||
@@ -262,6 +262,6 @@ func NewReportable() Reportable { return &MyGate{} }
|
||||
|
||||
1. **Symbol table generation:** Run `yaegi extract` as a `go generate` step, or generate on daemon startup?
|
||||
2. **Error handling:** If the interpreted gate panics or times out, park the task? Or fall back to shell-only gate?
|
||||
3. **Budget:** Interpreted gate scripts run in the gate stage — should they have their own timeout/step budget?
|
||||
3. **Budget:** Interpreted gate scripts run in the gate stage -- should they have their own timeout/step budget?
|
||||
4. **Template system:** Should archie-core ship with common gate templates (e.g. `go: no panic, no Sleep, no hardcoded paths`)?
|
||||
5. **Remote gates:** Could `.archie/gate.go` be pulled from a shared remote registry, like skills?
|
||||
Reference in new issue
Block a user