AGENTS.md@pkg/types · diff
git:20260724.cb0170c to git:20260802.0834ab9
4 added, 1 removed. Audit A to A.
# Types Package
Shared types: rulesets, message payloads, protocol, KV, models.
## Entry points
- - Core: `types.go`, `kv.go`, `msg.go`, `errors.go`, `event.go`, …
+ - Core: `types.go`, `kv.go`, `msg.go`, `instruct.go`, `form_state.go`, `run_state.go`, `resource.go`, `errors.go`, `event.go`, …
- Protocol: `protocol/` (Driver/Adapter/Action, messages, errors)
- Rulesets: `ruleset/{command,form,webservice}/`
- DTOs: `model/`; also `audit/`, stats helpers (`pipeline_stats`, `token_usage_*`, `run_latency_stats`)
Look at the package directory for the full file list.
## Boundaries
- Prefer `KV` over raw `map[string]any` for structured access (`map[string]any` OK in `capability.Invoke` params / protocol / generated code)
- Never define new message types outside this package
- New message types must implement `MsgPayload.Convert()`
+ - Never import `internal/*` (including `ent/schema`)
+ - Instruct*, FormState, PipelineState, WorkflowRunState, ResourceRef/Edge, PipelineNamePattern/ValidatePipelineName and other shared domain enums/types owned here; store schemas type-alias when needed
+ - UI/transport DTOs stay under `model/` (including pipeline/workflow run rows and ResourceLink); do not leak ORM entities into this package
## Testing
```bash
go test ./pkg/types/...
```