I1801 — A scripted capability is a kind, discovered and registered, runnable and projected like any capability
Make a capability declared in a file of the layer, with a Rhai script as its handler, a capability of the one registry: discovered by the index as a kind, validated with errors naming file and field, runnable through majordomus run, and projected onto the command line, MCP, OpenAPI and the generated reference by the projections that already exist.
READY wave 1 · p1 · implementation profile · runs alone
Part of automation — Repository automation is scripted capabilities over typed Rust, not shell.
Ready. Every dependency is done, so majordomus plan start I1801 will be accepted.
Objective
Make a capability declared in a file of the layer, with a Rhai script as its handler, a capability of the one registry: discovered by the index as a kind, validated with errors naming file and field, runnable through majordomus run, and projected onto the command line, MCP, OpenAPI and the generated reference by the projections that already exist.
Why
ADR 0069 refuses a second registry (project.no-new-nouns). A script reaches the repository only through capabilities, by one host function that calls Context::execute, so validation, redaction, counters and the execution plane apply to every call a script makes; and the host refuses a callee whose effect exceeds the script's declared effect.
Current state
Capabilities come from Rust modules and from declarative objects as resources only; nothing turns a layer file into an executable capability.
Desired state
A capability kind with a versioned schema and a script kind beside it; the registry builds an executable capability from each definition; one real scripted capability ships composing read-only capabilities; case 383 drives it end to end.
Scope
- apps/majordomus-cli
- share
- .ai/repo
- docs
- test
- SECURITY.md
Out of scope
- Migrating shell scripts; that is I1804
- A function that takes a shell command string
Dependencies
What waits on this
- I1804BLOCKED The first shell scripts become scripted capabilities over typed Rust
- I3157BLOCKED A scripted capability declared in an adopting repository's layer reaches its surfaces with no change to the tool, and says where it came from and what it may do
- I3305BLOCKED A scripted capability installed from outside the repository registers like one inside it
Acceptance criteria
- a definition with an unknown key or a missing script is refused naming the file and field
- a compile error names the script file, line and column
- a runtime error names the script file, line and column
- a call to a capability whose effect exceeds the declared effect is refused
- a cancelled execution of a scripted capability stops
- the scripted capability appears in capabilities list, OpenAPI and MCP after generate with no edit elsewhere
Validation
- cargo test --manifest-path apps/majordomus-cli/Cargo.toml --lib script::
- bash test/run.sh 383_a_scripted_capability_runs
Evidence required
- scripted_capability_projected_everywhere
- effect_ceiling_enforced
Evidence
None recorded. Every token above needs a command or an artifact behind it before this issue can be completed; narrative is refused.
Timeline
- started
- —
- verified
- —
- completed
- —
Those three fields, the evidence above and the state of the dependencies are all the status is made of. There is no status field to disagree with them.
Canonical record: .ai/repo/project/issues/I1801.yaml. Read it back with majordomus plan show I1801.