Skip to content

Commit fb0414f

Browse files
author
SIN CI
committed
merge: resolve main conflicts in PR #200 (issue #173)
2 parents 7d937cb + 3e76eac commit fb0414f

186 files changed

Lines changed: 24110 additions & 1411 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎AGENTS.md‎

Lines changed: 146 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
> `github-skills/` category added; 34 bundled skills embedded in the
1414
> binary. Branch protection on `main` permanently relaxed to
1515
> `required_approving_review_count: 0` for solo-maintainer workflow.
16+
> `sin-code install` (issue #170) — new 40th subcommand; root `install.sh`
17+
> rewritten to a 27-line curl|bash shim; matching `install.ps1` for Windows.
1618
1719
---
1820

@@ -231,7 +233,8 @@ SIN-Code/
231233
│ ├── ceo-audit.yml ← n8n delegation (mandate M1)
232234
│ ├── sin-code-release.yml ← goreleaser + brew tap
233235
│ └── ecosystem-sync.yml ← prevents registry/permission/ECOSYSTEM drift
234-
├── install.sh
236+
├── install.sh ← 27-line curl|bash shim → `sin-code install` (issue #170)
237+
├── install.ps1 ← PowerShell equivalent shim (issue #170)
235238
├── profiles/ ← v3.4.0: agent profile TOML files
236239
│ ├── fireworks.toml
237240
│ └── qwen-relay.toml
@@ -242,7 +245,7 @@ SIN-Code/
242245
│ └── mcp.json.example
243246
│
244247
├── cmd/
245-
│ ├── sin-code/ ← MAIN BINARY (39 subcommands — v3.13.0)
248+
│ ├── sin-code/ ← MAIN BINARY (40 subcommands — v3.18.0)
246249
│ │ ├── main.go ← cobra root; AddCommand for all subcommands
247250
│ │ ├── tui.go, webui_cmd.go
248251
│ │ ├── chat_cmd.go ← v3.4.0: chat + -p headless
@@ -260,8 +263,9 @@ SIN-Code/
260263
│ │ ├── hub_cmd.go ← v3.12.0: tool catalog hub subcommand
261264
│ │ ├── ledger_cmd.go ← v3.13.0: ledger query subcommand
262265
│ │ ├── summary_cmd.go ← v3.13.0: summary builder subcommand
266+
│ │ ├── install_cmd.go ← v3.18.0: `sin-code install` (issue #170, single-binary installer)
263267
│ │ ├── permission_defaults.go ← C4: default rules + MCP prefix policy
264-
│ │ └── internal/ ← 17 packages (v3.8.0)
268+
│ │ └── internal/ ← 18 packages (v3.18.0)
265269
│ │ ├── agentloop/ ← PLAN→ACT→VERIFY→DONE loop
266270
│ │ ├── session/ ← SQLite-backed resumable sessions
267271
│ │ ├── permission/ ← allow/ask/deny engine
@@ -272,6 +276,30 @@ SIN-Code/
272276
│ │ ├── lessons/ ← v3.4.0: closed learning loop
273277
│ │ ├── autonomy/ ← v3.5.0: goal queue + triggers
274278
│ │ ├── skillmgr/ ← v3.5.0: install/verify skills
279+
│ │ ├── skilldist/ ← v3.17.0: marker-fenced skill distribution (issue #169)
280+
│ │ ├── loopbuilder/ ← v3.4.0: shared factory (DRY)
281+
│ │ ├── vane/ ← v3.8.0: HTTP bridge to ItzCrazyKns/Vane (internal/vane)
282+
│ │ ├── stack/ ← v3.8.0: unified install/doctor across 3 layers
283+
│ │ ├── hub/ ← v3.12.0: static tool catalog
284+
│ │ ├── ledger/ ← v3.13.0: semantic session ledger (SQLite)
285+
│ │ ├── summary/ ← v3.13.0: deterministic session summary builder
286+
│ │ ├── install/ ← v3.18.0: pure-stdlib release install + SHA256 verify + atomic place (issue #170)
287+
│ │ ├── llm/ ← provider layer
288+
│ │ ├── style/ ← v3.17.0: verbosity / compression mode system-prompt renderer (issue #167)
289+
│ │ ├── orchestrator/ ← DAG, critic, adversary, governor, ...
290+
│ │ ├── memory/ ← (existing) store/search/embed
291+
│ │ ├── lsp/, notifications/, todo/, plugins/, sandbox/, attachments/, webui/
292+
│ │ ├── agentloop/ ← PLAN→ACT→VERIFY→DONE loop
293+
│ │ ├── session/ ← SQLite-backed resumable sessions
294+
│ │ ├── permission/ ← allow/ask/deny engine
295+
│ │ ├── verify/ ← mandatory PoC/Oracle gate
296+
│ │ ├── mcpclient/ ← external MCP consumption
297+
│ │ ├── hooks/ ← 24 lifecycle events
298+
│ │ ├── commands/ ← custom slash commands
299+
│ │ ├── lessons/ ← v3.4.0: closed learning loop
300+
│ │ ├── autonomy/ ← v3.5.0: goal queue + triggers
301+
│ │ ├── skillmgr/ ← v3.5.0: install/verify skills
302+
│ │ ├── skilldist/ ← v3.18.0: marker-fenced skill distribution (issue #169)
275303
│ │ ├── loopbuilder/ ← v3.4.0: shared factory (DRY)
276304
│ │ ├── vane/ ← v3.8.0: HTTP bridge to ItzCrazyKns/Vane (internal/vane)
277305
│ │ ├── stack/ ← v3.8.0: unified install/doctor across 3 layers
@@ -280,6 +308,7 @@ SIN-Code/
280308
│ │ ├── summary/ ← v3.13.0: deterministic session summary builder
281309
│ │ ├── mcpcompress/ ← v3.19.0: ponytail-tag compressor for `serve --compress-tools`
282310
│ │ ├── llm/ ← provider layer
311+
│ │ ├── style/ ← v3.17.0: verbosity / compression mode system-prompt renderer (issue #167)
283312
│ │ ├── orchestrator/ ← DAG, critic, adversary, governor, ...
284313
│ │ ├── memory/ ← (existing) store/search/embed
285314
│ │ ├── lsp/, notifications/, todo/, plugins/, sandbox/, attachments/, webui/
@@ -323,6 +352,25 @@ Goal Queue DB: `~/.local/share/sin-code/goals.db` (SQLite, modernc).
323352
Ledger DB: `~/.local/share/sin-code/ledger.db` (SQLite, modernc), overridable
324353
via `SIN_CODE_LEDGER`.
325354

355+
### Verbosity / compression mode (issue #167)
356+
357+
| Config key | Allowed values | Default |
358+
|---|---|---|
359+
| `llm.style` | `default` \| `verbose` \| `normal` \| `terse` \| `ultra` | `default` |
360+
361+
The setting is read at startup and forwarded into
362+
`internal/style.RenderRules` via `wiring.Deps.Style` and
363+
`learning.Learner.BeforeTurn`. The renderer is dependency-free
364+
(contributes bytes only) and is byte-stable per `(mode, skillBody)`
365+
pair — a prerequisite for the system-prompt hash metric (issue #2).
366+
`default` and `verbose` are pass-throughs (no ruleset injected);
367+
`normal`, `terse`, `ultra` emit the caveman-derived ruleset that
368+
drops pleasantries, hedging, and tool-call narration while preserving
369+
every byte of code, URLs, paths, error strings, and `func`/`var`/
370+
`const` names. Every ruleset carries the **auto-clarity** clause
371+
that drops to normal prose around destructive, security-relevant, or
372+
order-sensitive actions (mandate M3, the verification gate is sacred).
373+
326374
Headless JSON contract (stable API — never break without major bump):
327375

328376
```json
@@ -353,6 +401,9 @@ Headless JSON contract (stable API — never break without major bump):
353401
| v3.16.0 | ✅ SHIPPED | Forge integration (#37): `sin forge` command, `sin status` detection, 16th MCP tool in `mcp_config` |
354402
| v3.19.0 | ✅ SHIPPED | `sin-code serve --compress-tools` (issue #173): ponytail-tag compressor in `internal/mcpcompress/` shrinks the 47-tool manifest on the wire. Tag set `delete|stdlib|native|yagni|shrink`, subset via `--compress-tags`, savings reported via `--print-stats`. Tool names, schemas, and behavior are unchanged (AGENTS.md §10). Closing #173. |
355403

404+
| v3.18.0 | ACTIVE | `sin-code install` + curl|bash shim + PowerShell (issue #170): new 40th subcommand + internal/install/ package, 27-line install.sh mirror + 35-line install.ps1, SHA256-verified single-binary downloads from goreleaser assets |
405+
| (next) | TBD | eval/trace infra hardening + first-party golden-dataset CI gate (issue #75 phase 2) |
406+
356407
Each release tag ⇒ goreleaser builds linux/darwin/windows × amd64/arm64,
357408
updates `homebrew-sin` formula, and ships to GitHub Releases.
358409

@@ -402,19 +453,57 @@ Each skill **must** contain:
402453
Skills ported from external repos (e.g. `Infra-SIN-OpenCode-Stack`) must include
403454
`lifecycle: external` and `sources:` in their metadata.
404455

456+
### Skill distribution to external agents (issue #169)
457+
458+
`sin-code skill install <name> --agent <target>` distributes a bundled
459+
Skill artifact to one of eight registered agent families. The single
460+
source of truth is `cmd/sin-code/internal/skilldist/Targets`:
461+
462+
| Target | Format | Install path template (relative to `$SIN_CODE_HOME`) |
463+
|---|---|---|
464+
| `claude-code` | `dir` | `.claude/skills/<skill>` |
465+
| `opencode` | `dir` | `.config/opencode/skills/<skill>` |
466+
| `gemini` | `dir` | `.gemini/skills/<skill>` |
467+
| `codex` | `rule` | `.codex/rules/<skill>.md` |
468+
| `cursor` | `rule` | `.cursor/rules/<skill>.mdc` |
469+
| `windsurf` | `rule` | `.windsurf/rules/<skill>.md` |
470+
| `cline` | `rule` | `.clinerules/<skill>.md` |
471+
| `copilot` | `marker` | `.github/copilot-instructions.md` |
472+
473+
**Marker-fence contract.** Every write for `rule` and `marker` Formats
474+
goes through `ParseMarkers` so a subsequent install with the same
475+
`(target, skill)` pair replaces the previously written block in place:
476+
477+
```
478+
<!-- SIN-CODE-SKILL-START: <skill> -->
479+
… rendered body …
480+
<!-- SIN-CODE-SKILL-END: <skill> -->
481+
```
482+
483+
The leading/trailing ASCII prefix `SIN-CODE-SKILL` is the rg-friendly
484+
anchor. The trailing whitespace before `<skill>` on the END marker is
485+
visual alignment only — `ParseMarkers` strips it on lookup, so any
486+
strict matcher outside this package works too.
487+
488+
**Public API surface.** `(Target.Name, Target.DisplayName)` is exposed
489+
via the `--agent <name>` flag. Adding a target is non-breaking; renaming
490+
or removing one is a major bump. The `sin-code skill list --json`
491+
output schema is also a public API — preferred-format changes go through
492+
the same major-bump policy.
493+
405494
### CLI subcommands (verified `cmd/sin-code/main.go`, v3.5.0)
406495

407496
```
408497
Core: discover, execute, map, grasp, scout, harvest, orchestrate,
409498
ibd, poc, sckg, adw, oracle, efm
410499
Agents: chat, sessions, mcp, goal, daemon, skill, superpowers,
411-
vane, stack, gh
500+
vane, stack, gh, install
412501
Frontend: serve, tui, webui
413502
Lifecycle: memory, knowledge, todo, notifications, orchestrator_run,
414503
orchestrator_agents, orchestrator_plan, update
415504
Utility: read, write, edit, lsp, plugin, index, security, sbom,
416505
config, self-update, hub, ledger, summary
417-
``` (v3.13.0: 39 subcommands, up from 36 in v3.9.0)
506+
``` (v3.18.0: 40 subcommands; `install` is the v3.18.0 single-binary installer from issue #170)
418507
419508
### Hook events (verified `internal/hooks/hooks.go`, v3.5.0)
420509
@@ -503,9 +592,14 @@ and inspect trajectories visually (Langfuse / Jaeger / Arize Phoenix).
503592
| `cmd/sin-code/internal/dataset/runner.go` | Executes TestCases against the existing `agentloop.Loop` |
504593
| `cmd/sin-code/internal/eval/judge.go` | LLM-as-a-Judge via `internal/llm.Client` |
505594
| `cmd/sin-code/internal/eval/metrics.go` | Summary aggregation + JSON envelope for CI |
506-
| `cmd/sin-code/eval_cmd.go` | `sin-code eval run` + `sin-code eval list` |
595+
| `cmd/sin-code/internal/evalharness/arms.go` | v3.18.0 four-arm constructors (baseline / terse / lazy / `<skill>`) for issue #171 |
596+
| `cmd/sin-code/internal/evalharness/comparator.go` | v3.18.0 `Compare` runner producing per-arm aggregates |
597+
| `cmd/sin-code/internal/evalharness/prices.go` | v3.18.0 self-pricing price book (USD/1k tokens per model) |
598+
| `cmd/sin-code/internal/evalharness/snapshot.go` | v3.18.0 deterministic snapshot round-trip (caveman evals/README.md §3) |
599+
| `cmd/sin-code/eval_cmd.go` | `sin-code eval run` + `eval compare` + `eval snapshot` + `eval diff` (issue #171) |
507600
| `cmd/sin-code/trace_cmd.go` | `sin-code trace doctor` — exporter-only sanity check |
508601
| `evals/critical.json` | Example Golden Dataset (3 cases, no LLM needed) |
602+
| `evals/three-arm-example.json` | v3.18.0 four-arm bench, 3 cases (issue #171) |
509603
510604
### CLI surface
511605
@@ -523,10 +617,51 @@ sin-code eval run --dataset evals/critical.json \
523617
sin-code eval run --dataset evals/critical.json \
524618
--judge-model gpt-4o --judge-endpoint https://api.openai.com/v1
525619
620+
# Four-arm comparator (issue #171) — baseline / terse / lazy_skill / <user-skill>
621+
sin-code eval run --dataset evals/three-arm-example.json \
622+
--arm baseline,terse,lazy_skill,skill-code-create
623+
sin-code eval compare --dataset evals/three-arm-example.json
624+
sin-code eval snapshot --dataset evals/three-arm-example.json --out /tmp/snap.json
625+
sin-code eval diff --snapshot /tmp/snap-base.json --snapshot-b /tmp/snap-head.json
626+
526627
# Sanity-check the OTel exporter setup without a full eval
527628
sin-code trace doctor --exporter stdout --emit-sample-span
528629
```
529630

631+
### 12.1 Four-arm comparator (issue #171)
632+
633+
The comparator runs the same dataset against the four arms
634+
identified in the issue body:
635+
636+
| Arm | Reserved ID | SystemPrompt |
637+
|---|---|---|
638+
| baseline | `__baseline__` | empty (legacy single-arm behaviour) |
639+
| terse | `__terse__` | `"Answer concisely."` |
640+
| lazy skill | `__lazy_skill__` | terse-prefixed body of `skill-code-lazy` (issue #178) |
641+
| user skill | `<user-supplied>` | terse-prefixed body of the bundled skill named by `--skill` |
642+
643+
The **honest delta** between any candidate arm and the `terse`
644+
arm is what reviewers grade on. Comparing a skill directly to the
645+
baseline conflates the skill's content with the generic "be
646+
terse" instruction; the four-arm harness isolates them.
647+
648+
The output matrix mirrors ponytail's
649+
`benchmarks/README.md:34-58`:
650+
651+
| column | meaning |
652+
|---|---|
653+
| `pass_rate` | `Passed / TotalCases` |
654+
| `med_LOC` | median lines of output across cases |
655+
| `med_latency_ms` | median wall-clock per (case, arm) |
656+
| `med_usd` | median USD cost (using `prices.go` price book) |
657+
| `med_tokens` | median prompt + completion tokens |
658+
| `med_score` | median `Result.Score` per arm |
659+
660+
Snapshots are deterministic JSON: the comparator sorts every arm,
661+
median-recomputes every cell, and writes the same bytes for the
662+
same input on every CI run (caveman evals/README.md §3 promise:
663+
"snapshot committed to git so CI runs are deterministic and free").
664+
530665
### Hard mandates honored
531666

532667
- **M2 (single static binary, CGO_ENABLED=0):** pure-Go OTel SDK at
@@ -539,7 +674,7 @@ sin-code trace doctor --exporter stdout --emit-sample-span
539674
`github.com/OpenSIN-Code/SIN-Code/cmd/sin-code/...` everywhere.
540675
No `SIN-Code-Bundle` references.
541676
- **M7 (race-free):** every new test passes
542-
`go test -race -count=1 ./cmd/sin-code/internal/{trace,dataset,eval}/...`.
677+
`go test -race -count=1 ./cmd/sin-code/internal/{trace,dataset,eval,evalharness}/...`.
543678

544679
### Reference documentation
545680

@@ -556,4 +691,8 @@ sin-code trace doctor --exporter stdout --emit-sample-span
556691
vs reference `Loop.Run(ctx, sessID, prompt, RunOptions)`).
557692
- `cmd/sin-code/internal/eval/eval.doc.md` — judge prompt + JSON
558693
contract; `JudgeResult` schema.
694+
- `cmd/sin-code/internal/evalharness/comparator.doc.md` — four-arm
695+
`Compare` runner, arm constructors, snapshot round-trip (issue #171).
696+
- `cmd/sin-code/internal/evalharness/snapshot.doc.md` — deterministic
697+
matrix + diff (issue #171).
559698

0 commit comments

Comments
 (0)