Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ A second execution path is being built: an arrow-first translator that
compiles AgentScript into [Sibyl](https://github.com/vinodhalaharvi/sibyl)
DAGs for durable, Temporal-backed execution. The design is documented in
[`docs/dsl-to-sibyl-translator.md`](docs/dsl-to-sibyl-translator.md); the
translator code is under `internal/agentscript/script/`. The existing
translator code is under `pkg/script/`. The existing
in-process runtime continues to serve as the fast "memory" backend.

## Project Structure
Expand Down Expand Up @@ -366,7 +366,7 @@ go test ./...
go test -race ./...

# A single package
go test ./internal/agentscript/script/...
go test ./pkg/script/...
```

CI (GitHub Actions) runs `go mod tidy`, `go vet -structtag=false`, `gofmt`,
Expand Down
2 changes: 1 addition & 1 deletion cmd/agentscript-run/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (

sibyl "github.com/vinodhalaharvi/sibyl/agent"

"github.com/vinodhalaharvi/agentscript/internal/agentscript/script"
"github.com/vinodhalaharvi/agentscript/pkg/script"
)

func main() {
Expand Down
26 changes: 17 additions & 9 deletions docs/dsl-to-sibyl-translator.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# AgentScript → Sibyl: DSL Translator Design Memo

**Status:** Partially implemented. Parse and Resolve are merged; Lower → Submit and the CLI are in progress. See "Implementation status" below.
**Status:** Translator MVP complete. The full pipeline (Parse Resolve Lower → Finalize → Validate → Submit) is merged and importable at `pkg/script/`; `echo` runs end-to-end against Sibyl's `PlanWorkflow`. See "Implementation status" below.
**Companion repo:** [vinodhalaharvi/sibyl](https://github.com/vinodhalaharvi/sibyl) (the execution layer)
**Implements against:** Sibyl's `agents.WithOAuth` behavior, `ConvergeWorkflow`, `ToolAgentArrow`, `SupervisorWorkflow`, and the existing DAG execution model.

Expand All @@ -12,17 +12,25 @@ The translator is being built in slices (see §14). Current state:

| Phase | Arrow | Status |
|-------|-------|--------|
| Parse | `Arrow[Source, AST]` | **Merged** — `internal/agentscript/script/parse.go` |
| Resolve | `Arrow[AST, ResolvedAST]` | **Merged** — `internal/agentscript/script/resolve.go` + `registry/` |
| Lower | `Arrow[ResolvedAST, DAGFragment]` | Pending |
| Finalize | `Arrow[DAGFragment, sibyl.DAG]` | Pending |
| Validate | `Arrow[sibyl.DAG, sibyl.DAG]` | Pending |
| Submit | `Arrow[sibyl.DAG, WorkflowHandle]` | Pending |
| Parse | `Arrow[Source, AST]` | **Merged** — `pkg/script/parse.go` |
| Resolve | `Arrow[AST, ResolvedAST]` | **Merged** — `pkg/script/resolve.go` + `registry/` |
| Lower | `Arrow[ResolvedAST, Lowered]` | **Merged** — `pkg/script/lower.go` |
| Finalize | `Arrow[Lowered, sibyl.Plan]` | **Merged** — `pkg/script/lower.go` |
| Validate | `Arrow[sibyl.Plan, sibyl.Plan]` | **Merged** — `pkg/script/lower.go` |
| Submit | `Arrow[sibyl.Plan, WorkflowHandle]` | **Merged** — `pkg/script/submit.go` |

The full pipeline (`Compile` = Parse..Validate, `Run` = Compile + Submit)
is in `pkg/script/submit.go`, importable from outside the module. The
lowering target is Sibyl's serializable `Plan` (a DAG of named-activity
references) executed by the generic `PlanWorkflow` — not the removed
in-process closure DAG. The first builtin, `echo`, binds to Sibyl's
`Echo` activity; the `agentscript-run` CLI compiles a `.as` file to a
Plan (`--dry-run` to print it, otherwise submit to a Temporal worker).

On the Sibyl side, the convergence-primitive arrows this memo depends on
(`ConvergeArrow`, `SupervisorArrow`; `ToolAgentArrow` already existed) are
merged. The sections below describe the full design; phases marked Pending
above are specified but not yet built.
merged, as are the serializable `Plan`, `PlanWorkflow`, and `Echo`
activity the translator lowers into.

---

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ package script
import (
sibyl "github.com/vinodhalaharvi/sibyl/agent"

"github.com/vinodhalaharvi/agentscript/internal/agentscript/script/registry"
"github.com/vinodhalaharvi/agentscript/pkg/script/registry"
)

// EchoSpec is the BuiltinSpec for the echo builtin. It takes one
Expand Down
4 changes: 2 additions & 2 deletions internal/agentscript/script/lower.go → pkg/script/lower.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ import (

sibyl "github.com/vinodhalaharvi/sibyl/agent"

"github.com/vinodhalaharvi/agentscript/internal/agentscript/script/ast"
"github.com/vinodhalaharvi/agentscript/internal/agentscript/script/resolved"
"github.com/vinodhalaharvi/agentscript/pkg/script/ast"
"github.com/vinodhalaharvi/agentscript/pkg/script/resolved"
)

// fragment is a partial plan under construction. Nodes accumulate as the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (

sibyl "github.com/vinodhalaharvi/sibyl/agent"

"github.com/vinodhalaharvi/agentscript/internal/agentscript/script"
"github.com/vinodhalaharvi/agentscript/internal/agentscript/script/registry"
"github.com/vinodhalaharvi/agentscript/pkg/script"
"github.com/vinodhalaharvi/agentscript/pkg/script/registry"
)

// compile is a helper: source → Plan via the full Compile pipeline using
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"github.com/alecthomas/participle/v2"
"github.com/alecthomas/participle/v2/lexer"

"github.com/vinodhalaharvi/agentscript/internal/agentscript/script/ast"
"github.com/vinodhalaharvi/agentscript/pkg/script/ast"
)

// === Parse arrow ===========================================================
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"strings"
"testing"

"github.com/vinodhalaharvi/agentscript/internal/agentscript/script"
"github.com/vinodhalaharvi/agentscript/internal/agentscript/script/ast"
"github.com/vinodhalaharvi/agentscript/pkg/script"
"github.com/vinodhalaharvi/agentscript/pkg/script/ast"
)

// === Helpers ===============================================================
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package registry_test
import (
"testing"

"github.com/vinodhalaharvi/agentscript/internal/agentscript/script/registry"
"github.com/vinodhalaharvi/agentscript/pkg/script/registry"
)

func echoSpec() registry.BuiltinSpec {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ import (
"fmt"
"strings"

"github.com/vinodhalaharvi/agentscript/internal/agentscript/script/ast"
"github.com/vinodhalaharvi/agentscript/internal/agentscript/script/registry"
"github.com/vinodhalaharvi/agentscript/internal/agentscript/script/resolved"
"github.com/vinodhalaharvi/agentscript/pkg/script/ast"
"github.com/vinodhalaharvi/agentscript/pkg/script/registry"
"github.com/vinodhalaharvi/agentscript/pkg/script/resolved"
)

// Resolve binds an AST to a Registry, producing a ResolvedAST. Because
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import (
"errors"
"testing"

"github.com/vinodhalaharvi/agentscript/internal/agentscript/script"
"github.com/vinodhalaharvi/agentscript/internal/agentscript/script/ast"
"github.com/vinodhalaharvi/agentscript/internal/agentscript/script/registry"
"github.com/vinodhalaharvi/agentscript/internal/agentscript/script/resolved"
"github.com/vinodhalaharvi/agentscript/pkg/script"
"github.com/vinodhalaharvi/agentscript/pkg/script/ast"
"github.com/vinodhalaharvi/agentscript/pkg/script/registry"
"github.com/vinodhalaharvi/agentscript/pkg/script/resolved"
)

// === Test registry helpers =================================================
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
package resolved

import (
"github.com/vinodhalaharvi/agentscript/internal/agentscript/script/ast"
"github.com/vinodhalaharvi/agentscript/internal/agentscript/script/registry"
"github.com/vinodhalaharvi/agentscript/pkg/script/ast"
"github.com/vinodhalaharvi/agentscript/pkg/script/registry"
)

// AST is a fully resolved program: a list of resolved blocks.
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (

sibyl "github.com/vinodhalaharvi/sibyl/agent"

"github.com/vinodhalaharvi/agentscript/internal/agentscript/script/registry"
"github.com/vinodhalaharvi/agentscript/pkg/script/registry"
)

// Compile runs Parse >>> Resolve >>> Lower >>> Finalize >>> Validate,
Expand Down
Loading