Commit 934489d
feat(cli): agent-friendly meta CLI with --format/TOON output and deploy-all agent-context references (#71)
* feat(agent-context): deploy all language references; agent picks (robust to stack-detection miss)
The reference filter (assemble.ts) only installed references whose token was in
the detected stack; when detection came up empty (as in this monorepo's own
init), agents got zero language guidance. Deploy all references instead and let
the agent read the one matching its stack (SKILL.md already points to them).
Update the assemble tests + regenerate the conformance goldens (each stack now
assembles the full 22-file set); add a regen script for the corpus.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018mjBXyYKk6tbQymzhgMmdB
* docs(agent-context): add Python codegen reference (closes the python.md gap)
metaobjects-codegen shipped references for ts/java/kotlin/csharp but not python,
so Python adopters got no codegen guidance. Add python.md (accurate to the actual
Python port: entity->Pydantic, routes->FastAPI, no ORM, int-PK/dict[str,Any]
gaps, Node-owned migrate). Regenerate conformance goldens (now 23 files/stack).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018mjBXyYKk6tbQymzhgMmdB
* docs(spec): record deploy-all references override (supersedes stack-selective)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018mjBXyYKk6tbQymzhgMmdB
* docs(plan): Node meta CLI -> axi + TOON implementation plan (Plan 2 of 5)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018mjBXyYKk6tbQymzhgMmdB
* feat(cli): add output-format selector (TTY-aware) + TOON encode wrapper
* feat(cli): TOON+JSON gen formatters with axi aggregates + next-step help
* feat(cli): TOON+JSON migrate formatters with axi aggregates + next-step help
* feat(cli): --format flag (TTY-aware) routes gen/migrate through TOON/JSON/text
Extract --format globally in run() alongside --cwd; resolve once with
resolveFormat(flag, isTTY) and thread the OutputFormat into genCommand
and migrateCommand. Each command emits formatGenResultToon/Json or the
existing text formatter at the single log.info call site. Adds
--format <toon|json|text> to HELP_TEXT GLOBAL OPTIONS.
Tests: dispatch-level unit tests for resolveFormat selection + five
integration tests against the trainer-website-meta fixture asserting
TOON tabular shape, JSON parse, and text header; full suite 296 pass.
* test(cli): update init-scaffold tests for deploy-all references (Plan 1 fallout)
Replace stack-selective assertions (typescript.md absent) with deploy-all
assertions (all language references present) in init-agent-context and
init-docs-only unit tests. Test names updated to reflect the new behavior.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018mjBXyYKk6tbQymzhgMmdB
* fix(cli): axi-conformant meta migrate (--help, idempotent, declared libsql, PM-aware errors)
- Declare @libsql/kysely-libsql ^0.4.0 as a direct dep (was optional peer)
- Intercept --help/-h before strict parseMigrateArgs; print per-subcommand usage block
- Emit structured {error, hint} JSON/TOON on stdout for arg-parse failures
- Baseline discoverability: no-snapshot path emits JSON next-step hint on stdout
- PM-aware missing-dep error: detect lockfile (npm/pnpm/yarn/bun) and print matching install command
- 11 new tests in test/migrate-ux.test.ts; suite: 309 pass, 0 fail
* fix(cli): format-aware structured migrate errors on stdout (+ yarn pm-detect, drop stale devDep)
Thread fmt into runOfflineGenerate so no-snapshot hint uses emitStructuredError(fmt) instead
of hardcoded log.info(JSON.stringify(...)). Add top-level try/catch in migrateCommand with
AlreadyEmittedError sentinel so any unhandled sub-function throw emits structured error on
stdout in the active format (exit 1) without double-emitting. Add yarn pm-detect test case.
Remove stale @libsql/kysely-libsql from devDependencies (already in dependencies).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018mjBXyYKk6tbQymzhgMmdB
* feat(cli): per-subcommand --help, content-first no-args, 0/1/2 exit codes (axi)
* docs(agent-context): document --format + discoverable migrate baseline
* fix(cli): restore text-mode baseline hint + drop help[] refs to non-existent migrate subcommands
- Append "; run \`meta migrate baseline --dialect <dialect>\` first" to the
log.error() in the no-snapshot path so text/TTY users see the next step
(emitStructuredError is a no-op for text format; the structured hint was
already correct for json/toon).
- Replace the two fabricated help[] hints ("meta migrate status",
"meta migrate down --slug <name>") with the real rollback surface:
"roll back with \`meta migrate --rollback <target>\`".
- Extend captureCommand() in migrate-ux.test.ts to also capture stderr;
add a text-mode no-snapshot test asserting stderr contains "baseline".
- Update output-toon.test.ts help[] assertion from "status" to "--rollback".
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018mjBXyYKk6tbQymzhgMmdB
* no-mistakes(review): emit migrate branch errors on stdout; reject invalid --format
* no-mistakes(review): make migrate structured summary reflect written-vs-applied-vs-dry-run state
* no-mistakes(review): surface applied ledger files in migrate summary even with no fresh diff
* no-mistakes(review): make postgres missing-dep hint package-manager-aware in CLI kysely builder
* no-mistakes(document): sync CLI README with --format flag, per-command help, and bundled libsql driver
* fix(agent-context): deploy-all references in the C# + Python assemblers (cross-port parity)
The TS assembler was updated to deploy-all (emit every references/*.md regardless
of stack); the C# and Python ports still had the per-stack token filter, so the
byte-identity conformance gate failed for those ports.
Changes:
- server/python: drop `p.stem in stack.tokens` guard in assemble(); emit every
.md in references/ sorted, matching TS deploy-all semantics.
- server/csharp: drop `.Where(stack.Tokens.Contains)` from the LINQ chain in
AgentContextAssembler.Assemble(); same effect.
- fixtures/: regenerate conformance goldens via regen-agent-context-conformance.ts
to pick up the 03bd9b5b doc additions (typescript.md +4 lines, migration.md
+37 lines) that were missed when the goldens were last committed.
All conformance gates pass: Python 305/305, C# 670/670, CLI 35/35.
* docs(spec): single agent-context assembler (collapse per-port re-implementations)
Option A: Node meta is the sole assembler; Python/JVM/C# stop assembling +
embedding agent-context. Non-Node CLIs keep a non-executing pointer stub
redirecting to 'npx meta agent-docs --server <lang>'. Reconciles with ADR-0015
(Node/binary already required for migrate). Folded into this branch as deletions.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018mjBXyYKk6tbQymzhgMmdB
* docs(plan): single agent-context assembler implementation plan (delete per-port assemblers)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018mjBXyYKk6tbQymzhgMmdB
* feat(cli): add 'meta agent-docs --server <lang>' alias (canonical scaffolder for all ports)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* refactor(python): drop native agent-context assembler + embedding; agent-docs redirects to meta CLI
- Delete assemble.py, types.py, content_root.py (the Python-port assembler)
- Delete tests/conformance/test_agent_context_conformance.py (byte-identity test)
- Delete src/metaobjects/agent_context/_content/ (build-time vendored content tree)
- Stub _cmd_agent_docs in cli.py: prints redirect message to stderr, returns 1
- Keep scaffold.py (stripped to staleness-nudge symbols only: agent_context_staleness,
Manifest, AGENT_CONTEXT_MANIFEST_PATH, installed_metaobjects_version) — used by gen/verify
- Fix agent_context/__init__.py: drop assembler re-exports, keep staleness symbols
- Fix cli.py imports: drop assemble/make_stack/plan_scaffold/resolve_agent_context_root
- Remove dead _detect_python_server/_wire_root_doc helpers and _ROOT_DOC_* constants
- Neutralise hatch_build.py: no-op hook (no more _content vendoring)
- Drop _content/ from .gitignore
- Remove test_agent_docs_stamps_generated_by from staleness tests (stamp is Node CLI's job now)
1288 passed (was 1294: 5 conformance fixtures + 1 stamp test removed).
* refactor(java): drop native agent-context assembler + classpath embedding; agent-docs Mojo redirects to meta CLI
AssembledFile and Stack are retained — AgentContextScaffold.plan() takes both as
parameters and AgentContextScaffoldTest constructs them directly. Only
AgentContextAssembler and ContentRoot were assembly-only; they are deleted.
AgentContextConformanceTest (the byte-identity gate) is also deleted; it was
never in the CI -Dtest list (confirmed absent from conformance.yml).
* fix(java): delete dead agent-context scaffold-write path (plan/AssembledFile/Stack) + correct staleness nudge to npx meta
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* refactor(csharp): drop native agent-context assembler + embedded resources; agent-docs redirects to meta CLI
* docs(adr): ADR-0033 single agent-context assembler; redirect non-Node CLIs; supersede ADR-0027 non-goal
* fix(agent-context): ADR stub stream stdout→stderr; Python staleness nudge → npx meta agent-docs --server python
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018mjBXyYKk6tbQymzhgMmdB
* no-mistakes(document): sync docs to single agent-context assembler (ADR-0033) + CLI changes
* no-mistakes(lint): remove orphaned Manifest import in Python CLI
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 05439fb commit 934489d
120 files changed
Lines changed: 7668 additions & 2370 deletions
File tree
- agent-context/skills
- metaobjects-codegen/references
- metaobjects-verify/references
- docs
- features
- llms
- superpowers
- plans
- specs
- fixtures/agent-context-conformance
- java-kotlin-react-tanstack/expected/.claude/skills
- metaobjects-codegen/references
- metaobjects-prompts/references
- metaobjects-runtime-ui/references
- metaobjects-verify/references
- java-react/expected/.claude/skills
- metaobjects-codegen/references
- metaobjects-prompts/references
- metaobjects-runtime-ui/references
- metaobjects-verify/references
- python/expected/.claude/skills
- metaobjects-codegen/references
- metaobjects-prompts/references
- metaobjects-runtime-ui/references
- metaobjects-verify/references
- ts-react-tanstack/expected/.claude/skills
- metaobjects-codegen/references
- metaobjects-prompts/references
- metaobjects-runtime-ui/references
- metaobjects-verify/references
- server
- csharp
- MetaObjects.Cli.Tests
- MetaObjects.Cli
- MetaObjects.Conformance.Tests
- MetaObjects/AgentContext
- java
- maven-plugin
- src/main/java/com/metaobjects/mojo
- metadata/src
- main/java/com/metaobjects/agentcontext
- test/java/com/metaobjects/agentcontext
- python
- src/metaobjects
- agent_context
- tests
- conformance
- unit
- typescript/packages
- cli
- src
- commands
- lib
- test
- __snapshots__
- lib
- unit
- sdk
- scripts
- src/agent-context
- test/agent-context
- spec/decisions
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 76 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
132 | 136 | | |
133 | 137 | | |
134 | 138 | | |
| |||
Lines changed: 37 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
24 | 39 | | |
25 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
26 | 63 | | |
27 | 64 | | |
28 | 65 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
177 | | - | |
| 177 | + | |
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
| |||
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
| 223 | + | |
228 | 224 | | |
229 | | - | |
| 225 | + | |
230 | 226 | | |
231 | | - | |
| 227 | + | |
232 | 228 | | |
233 | 229 | | |
234 | 230 | | |
| |||
283 | 279 | | |
284 | 280 | | |
285 | 281 | | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
| 282 | + | |
293 | 283 | | |
294 | | - | |
295 | | - | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
296 | 290 | | |
297 | 291 | | |
298 | 292 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
90 | 91 | | |
91 | 92 | | |
92 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
93 | 113 | | |
94 | 114 | | |
95 | 115 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
0 commit comments