feat(cli): metadata-generation lint rules + quality scorer + eval harness#1625
Merged
Conversation
…ness
Make "metadata should be AI-generated" checkable: a linter that catches the
data-modeling anti-patterns an author (human or AI) makes, and an eval harness
that scores generation quality using that linter as the rubric.
Lint (extends `objectstack lint` / lintConfig):
- New cross-object data-model rules: relationship/missing-reference,
master-detail-required, delete-behavior, line-items-inline-edit,
line-item-should-be-master-detail, association-inline-edit (anti-pattern),
rollup/missing-summary, field/select-missing-options, object/missing-name-field.
These encode ADR-0035 + the objectstack-data/-ui conventions.
Scorer (lint-as-rubric):
- scoreMetadata(stack) → 0–100 + grade + breakdown: schema validity
(ObjectStackDefinitionSchema) + weighted lint issues (schema/error/warning/
suggestion). Exposed via `objectstack lint --score`.
Eval harness (offline-first, optional live):
- runMetadataEval(cases, { generate? }) scores fixtures (offline) or generated
stacks (live seam). Golden corpus of 5 enterprise shapes. Surfaced via
`objectstack lint --eval [--generator <module>] [--eval-min N]`. The
--generator seam plugs a real model (AIService.generateObject<SolutionBlueprint>)
in without giving the CLI an LLM dependency.
Docs: objectstack-data skill gains a "Linting & Generation Quality" section.
Tests: 34 new unit tests (data-model-rules, score, metadata-eval) all green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Makes "metadata should be AI-generated" checkable. Adds a linter that catches the data-modeling anti-patterns an author (human or AI) makes, and an eval harness that scores generation quality using that linter as the rubric — offline-first, with an optional live-LLM seam.
Lint (extends
objectstack lint)New cross-object data-model rules in
lintConfig(encode ADR-0035 + objectstack-data/-ui conventions):relationship/missing-referencerelationship/master-detail-requiredrelationship/delete-behaviorrelationship/line-items-inline-editrelationship/line-item-should-be-master-detailrelationship/association-inline-edit(anti-pattern)rollup/missing-summaryfield/select-missing-optionsobject/missing-name-fieldScorer (lint-as-rubric)
scoreMetadata(stack)→ 0–100 + grade + breakdown = schema validity (ObjectStackDefinitionSchema) + weighted lint issues. Surfaced viaobjectstack lint --score.Eval harness (offline-first)
runMetadataEval(cases, { generate? })scores fixtures (offline) or generated stacks (live). Golden corpus of 5 enterprise shapes (invoice+lines, project+tasks, blog+comments [association], expense+lines, account+contacts). Surfaced via:objectstack lint --eval— offline, deterministic, no API key (each case must clear--eval-min, default 75)objectstack lint --eval --generator ./gen.mjs— live: module default-exports(prompt, id) => stack; wire it toAIService.generateObject<SolutionBlueprint>to benchmark a real model. The seam keeps the CLI free of an LLM dependency.Verification
tsc --noEmit: 0 errors in the touched files🤖 Generated with Claude Code