Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
ac44528
feat: Wave 1 — core package
ThePlenkov Aug 9, 2026
76f1f83
fix: address code review findings in packages/
ThePlenkov Aug 10, 2026
5d8947d
docs: fix markdown fence labels and placeholder content
ThePlenkov Aug 10, 2026
1fcb720
fix: add legacy eslint engine name to .codacy.yml disable_rules
ThePlenkov Aug 10, 2026
0f7210f
fix: add .eslintrc.json to disable es-x rules for Codacy ESLint 8
ThePlenkov Aug 10, 2026
0ac1b58
fix: use exclude_paths instead of invalid disable_rules in .codacy.yml
ThePlenkov Aug 10, 2026
9c2af84
chore: add tmp/ to .gitignore
ThePlenkov Aug 10, 2026
eb575bd
refactor: reduce cyclomatic complexity in tokenize and topoSort
ThePlenkov Aug 10, 2026
7c152bb
refactor: use lookup tables in tokenizeOperator to reduce complexity
ThePlenkov Aug 10, 2026
6f97cc3
test: improve test assertions and add unknown-dep test
ThePlenkov Aug 10, 2026
e14bb06
fix: runtime safety and condition handling in planner
ThePlenkov Aug 10, 2026
5a1305c
fix: make outcomes required, add RuntimeFinalization type, widen Oper…
ThePlenkov Aug 10, 2026
5fd19f8
refactor: plan.ts complexity, performance, and correctness improvements
ThePlenkov Aug 10, 2026
ff14e45
fix: escape delimiters in matrix child IDs and reject duplicate values
ThePlenkov Aug 10, 2026
87f6729
docs: add ADR-006 and canonical.ts implementation
ThePlenkov Aug 10, 2026
07a0a39
test: add public API tests for CliError, PolicyError, RuntimeError
ThePlenkov Aug 10, 2026
a09ab0a
fix: resolve SonarCloud and Codacy complexity findings
ThePlenkov Aug 10, 2026
c1dbec0
refactor(core): address CodeRabbit review feedback for PR #1
devin-ai-integration[bot] Aug 11, 2026
bc9349d
fix(core): remove JSON.stringify from canonical serialization and mat…
devin-ai-integration[bot] Aug 11, 2026
e6cb772
refactor(core): rename canonicalJson to canonicalStringify and reject…
devin-ai-integration[bot] Aug 11, 2026
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
107 changes: 107 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
{
"root": true,
"parserOptions": {
"ecmaVersion": 2024,
"sourceType": "module"
},
"rules": {
"es-x/no-arrow-functions": "off",
"es-x/no-modules": "off",
"es-x/no-block-scoped-variables": "off",
"es-x/no-trailing-commas": "off",
"es-x/no-template-literals": "off",
"es-x/no-classes": "off",
"es-x/no-default-parameters": "off",
"es-x/no-destructuring": "off",
"es-x/no-rest-spread-properties": "off",
"es-x/no-spread-elements": "off",
"es-x/no-async-functions": "off",
"es-x/no-generators": "off",
"es-x/no-for-of-loops": "off",
"es-x/no-exponential-operators": "off",
"es-x/no-promise-objects": "off",
"es-x/no-symbol": "off",
"es-x/no-map": "off",
"es-x/no-set": "off",
"es-x/no-weak-map": "off",
"es-x/no-weak-set": "off",
"es-x/no-proxy": "off",
"es-x/no-reflect": "off",
"es-x/no-binary-numeric-literals": "off",
"es-x/no-octal-numeric-literals": "off",
"es-x/no-regex-u-flag": "off",
"es-x/no-regex-y-flag": "off",
"es-x/no-unicode-codepoint-escapes": "off",
"es-x/no-object-super-properties": "off",
"es-x/no-array-prototype-copywithin": "off",
"es-x/no-array-prototype-fill": "off",
"es-x/no-array-prototype-find": "off",
"es-x/no-array-prototype-findindex": "off",
"es-x/no-array-prototype-flat": "off",
"es-x/no-array-prototype-flatmap": "off",
"es-x/no-array-prototype-includes": "off",
"es-x/no-array-prototype-keys": "off",
"es-x/no-array-prototype-values": "off",
"es-x/no-array-prototype-entries": "off",
"es-x/no-string-prototype-at": "off",
"es-x/no-string-prototype-codepoint-at": "off",
"es-x/no-string-prototype-ends-with": "off",
"es-x/no-string-prototype-includes": "off",
"es-x/no-string-prototype-match-all": "off",
"es-x/no-string-prototype-pad-end": "off",
"es-x/no-string-prototype-pad-start": "off",
"es-x/no-string-prototype-repeat": "off",
"es-x/no-string-prototype-starts-with": "off",
"es-x/no-string-prototype-trim": "off",
"es-x/no-string-prototype-trimstart": "off",
"es-x/no-string-prototype-trimend": "off",
"es-x/no-string-raw": "off",
"es-x/no-number-constructor": "off",
"es-x/no-number-isfinite": "off",
"es-x/no-number-isinteger": "off",
"es-x/no-number-isnan": "off",
"es-x/no-number-issafeinteger": "off",
"es-x/no-number-max-safe-integer": "off",
"es-x/no-number-min-safe-integer": "off",
"es-x/no-number-epsilon": "off",
"es-x/no-number-parse-float": "off",
"es-x/no-number-parse-integer": "off",
"es-x/no-math-acosh": "off",
"es-x/no-math-asinh": "off",
"es-x/no-math-atanh": "off",
"es-x/no-math-cbrt": "off",
"es-x/no-math-clz32": "off",
"es-x/no-math-cosh": "off",
"es-x/no-math-expm1": "off",
"es-x/no-math-fround": "off",
"es-x/no-math-hypot": "off",
"es-x/no-math-imul": "off",
"es-x/no-math-log10": "off",
"es-x/no-math-log1p": "off",
"es-x/no-math-log2": "off",
"es-x/no-math-sign": "off",
"es-x/no-math-sinh": "off",
"es-x/no-math-tanh": "off",
"es-x/no-object-assign": "off",
"es-x/no-object-is": "off",
"es-x/no-object-entries": "off",
"es-x/no-object-fromentries": "off",
"es-x/no-object-getownpropertydescriptors": "off",
"es-x/no-object-values": "off",
"es-x/no-object-keys": "off",
"es-x/no-object-define-property": "off",
"es-x/no-object-define-properties": "off",
"es-x/no-object-create": "off",
"es-x/no-object-get-prototype-of": "off",
"es-x/no-object-set-prototype-of": "off",
"es-x/no-date-prototype-to-primitive": "off",
"es-x/no-symbol-prototype-description": "off",
"es-x/no-intl": "off",
"es-x/no-atomics": "off",
"es-x/no-shared-array-buffer": "off",
"es-x/no-rest-parameters": "off",
"no-unused-vars": "off",
"no-non-null-assertion": "off",
"security/detect-object-injection": "off"
}
}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,6 @@ website/node_modules/
*.db
.beads-credential-key
.beads/proxieddb/

# Temporary files
tmp/
6 changes: 5 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ engdocs/ # engineering docs (document-first)
```bash
bun install # install dependencies
bun run build # build all packages (tsdown via nx)
bun test # run all tests (vitest)
bun run test # run all tests (vitest via nx); NOTE: `bun test` runs Bun's built-in runner, not vitest
bun run lint # lint all packages
bun run typecheck # typecheck all packages
```
Expand All @@ -71,6 +71,10 @@ all work. Agents: mayor (orchestrator), architect (specs/design), builder
All work flows through the mayor. Use formulas in `formulas/` for multi-step
orchestration.

**Model:** All agents use `DEVIN_MODEL=glm-5-2` (GLM-5.2 High, free tier).
This is set in `city.toml` at the `[workspace]` env level. Do not override
this with a paid model.

<!-- BEGIN BEADS INTEGRATION v:1 profile:minimal hash:970c3bf2 -->
## Beads Issue Tracker

Expand Down
21 changes: 14 additions & 7 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,25 @@ This protocol applies when ending a Beads implementation workflow. It is subordi

## Build & Test

_Add your build and test commands here_

```bash
# Example:
# npm install
# npm test
bun install # install dependencies
bun run build # build all packages (tsdown via nx)
bun run test # run all tests (vitest via nx)
bun run lint # lint all packages
bun run typecheck # typecheck all packages
```

## Architecture Overview

_Add a brief overview of your project architecture_
Sverka is a composable workflow SDK, local CI runtime, and multi-target
compiler for software verification. See `engdocs/architecture/overview.md`
for the full architecture overview.

## Conventions & Patterns

_Add your project-specific conventions here_
- **SDD:** Specs are written first, in `specs/`, numbered and structured.
- **TDD:** Tests are written before implementation.
- **Document-first:** Engineering docs in `engdocs/` before code.
- **No `any`:** Use `unknown` and narrow. Strict TypeScript.
- **Public API:** Everything public is exported from `src/index.ts`.
- **Error handling:** Custom error classes per package.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ sverka compile --target gitlab

## Architecture

```
```text
┌─────────────────────┐
│ Workflow SDK / DSL │
└──────────┬──────────┘
Expand Down Expand Up @@ -138,7 +138,7 @@ sverka compile --target gitlab

bun install # install dependencies
bun run build # build all packages (tsdown via nx)
bun test # run all tests (vitest)
bun run test # run all tests (vitest via nx); NOTE: `bun test` runs Bun's built-in runner, not vitest
bun run lint # lint all packages (eslint)
bun run typecheck # typecheck all packages
```
Expand All @@ -155,7 +155,7 @@ bun run typecheck # typecheck all packages

## Project structure

```
```text
packages/ # monorepo packages
specs/ # numbered spec tree (spec-driven development)
engdocs/ # engineering docs (architecture, ADRs, contributing)
Expand Down
2 changes: 1 addition & 1 deletion agents/architect/agent.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
scope = "city"
session = "acp"
wake_mode = "resume"
42 changes: 37 additions & 5 deletions agents/architect/prompt.template.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,33 @@ You are the **architect** agent in the Sverka Gas City workspace. You are
activated on-demand by the mayor to design specs, plan implementation
approaches, and make structural decisions.

## Personality

You are a **ruthless minimalist and a paranoid critic**. Every type you define
must earn its place. Every abstraction must prove it prevents more pain than it
causes. You design as if every line of code written after your spec will be a
liability — because it will.

- **Laconic.** If a spec section can be 3 lines, it's 3 lines. Not 30.
- **Hostile to complexity.** YAGNI is not a guideline, it's a law. You reject
features that "might be useful later" without a concrete use case.
- **Evidence-driven.** You don't guess at existing patterns — you read the
codebase, check `engdocs/adr/`, and cite what's already there.
- **Anti-sycophancy.** If the mayor's request is over-engineered, you push back
with a simpler alternative. You design what's correct, not what was asked.

## Mandatory skills

Always invoke these skills before designing:

- `skill spec-driven-development` — structure specs properly
- `skill minimalist` — audit your own design for bloat
- `skill critical-thinking` — challenge every type, every interface, every
abstraction. Does it need to exist? Can it be simpler? Can it be nothing?
- `skill deepwiki` — when researching how external libraries (nx, tsdown,
vitest, dolt, etc.) work, use DeepWiki instead of guessing
- `skill sourcegraph` — search the codebase with `src` CLI, not just grep
Comment thread
ThePlenkov marked this conversation as resolved.

## Project

Sverka is a composable workflow SDK, local CI runtime, and multi-target
Expand All @@ -14,19 +41,24 @@ spec-first (SDD), test-first (TDD), built in waves.

1. **Design specs** — write numbered specs in `specs/` following the
established tree structure.
2. **Plan approaches** — for each wave, produce an implementation plan.
2. **Plan approaches** — for each wave, produce an implementation plan that
the builder can follow step by step. Minimal steps. No gold-plating.
3. **Review structure** — ensure code structure matches the spec tree.
4. **Document decisions** — record architectural decisions in `engdocs/adr/`.
5. **Define interfaces** — produce TypeScript interfaces and type definitions.
Only export what's used. No speculative API.

## How to work

1. Read the relevant specs in `specs/` before designing.
2. Read `engdocs/` for existing architectural context.
3. Write specs as numbered files: `specs/NN-<name>/spec.md`.
4. Each spec must include: Overview, Goals, Non-goals, Interfaces, Data
models, Error handling, Test plan.
5. When done, report back to the mayor via mail.
3. Invoke `skill spec-driven-development` to structure the spec.
4. Invoke `skill minimalist` to audit your design — cut everything non-essential.
5. Invoke `skill critical-thinking` — challenge every decision in your spec.
6. Write specs as numbered files: `specs/NN-<name>/spec.md`.
7. Each spec must include: Overview, Goals, Non-goals, Interfaces, Data
models, Error handling, Test plan. Keep each section as short as possible.
8. When done, report back to the mayor via mail.

## Conventions

Expand Down
2 changes: 1 addition & 1 deletion agents/builder/agent.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
scope = "city"
session = "acp"
wake_mode = "resume"
46 changes: 40 additions & 6 deletions agents/builder/prompt.template.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,35 @@ You are the **builder** agent in the Sverka Gas City workspace. You are
activated on-demand by the mayor to implement code from specs, following
TDD strictly.

## Personality

You are a **surgical implementer and a relentless driller**. You don't guess —
you verify. When something breaks, you drill down to the root cause before
touching code. You write the minimum code that passes tests — no more, no less.

- **Surgical.** Smallest possible diff. Every line you write is a line someone
has to maintain. Write less.
- **Drill-first.** When a test fails or a build breaks, you don't patch
symptoms. You invoke `skill drill` to isolate the root cause in a scoped
frame, understand it, then fix it.
- **TDD-strict.** Red-green-refactor. No implementation before tests. No
skipping tests because "it's trivial." Everything is tested.
- **Reuse before create.** Before writing new code, check if the codebase
already has a utility, type, or pattern that does the job.

## Mandatory skills

Always invoke these skills when working:

- `skill test-driven-development` — every implementation starts with tests
- `skill investigate-first` — before editing, understand the code area
- `skill minimal-root-cause` — before patching a bug, climb the laziness ladder
- `skill drill` — when a test fails unexpectedly or a build breaks, create a
drill frame to isolate the issue. Don't flail — drill.
- `skill minimalist` — audit your implementation for unnecessary code
- `skill deepwiki` — when you need to understand how a dependency works
- `skill sourcegraph` — search the codebase with `src` CLI for existing patterns
Comment thread
ThePlenkov marked this conversation as resolved.

## Project

Sverka is a composable workflow SDK, local CI runtime, and multi-target
Expand All @@ -16,17 +45,22 @@ spec-first (SDD), test-first (TDD), built in waves.
2. **TDD strictly** — write failing tests first, then implement until passing.
3. **Follow conventions** — match existing code style, use existing utilities.
4. **Build verification** — run `bun run build` after implementation.
5. **Report completion** — when done, report back to the mayor via mail.
5. **Drill failures** — when tests fail or build breaks, drill to root cause
before patching. Never paper over symptoms.
6. **Report completion** — when done, report back to the mayor via mail.

## How to work

1. Read the assigned spec in `specs/`.
2. Read the relevant engineering docs in `engdocs/`.
3. Write tests first in `<package>/src/__tests__/<name>.test.ts`.
4. Run tests: `bun test`.
5. Implement until tests pass.
6. Run build: `bun run build`.
7. Report to mayor.
3. Invoke `skill investigate-first` to understand the code area.
4. Invoke `skill test-driven-development` — write failing tests first.
5. Run tests: `bun test`. Confirm they fail for the right reason.
6. Implement until tests pass.
Comment thread
ThePlenkov marked this conversation as resolved.
7. Invoke `skill minimalist` — cut any code that isn't needed.
8. Run build: `bun run build`.
9. If anything breaks: `skill drill` — isolate, understand, fix.
10. Report to mayor.

## Conventions

Expand Down
2 changes: 2 additions & 0 deletions agents/control-dispatcher/agent.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
scope = "city"
max_active_sessions = 1
2 changes: 1 addition & 1 deletion agents/mayor/agent.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
scope = "city"
session = "acp"
wake_mode = "resume"
Loading