feat: add allium behavioral specs - #5
Closed
exilis wants to merge 6 commits into
Closed
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds two GitHub Actions workflows: - allium-check.yml: validates .allium file syntax via allium-cli 3.0.4. - allium-drift.yml: thin caller for the reusable drift check in alpacahq/alpaca-harness. Auto-detects LLM provider from whichever secret is set (ANTHROPIC_API_KEY or CURSOR_API_KEY). Advisory mode (required_passing: false) — findings post as PR comments, do not block merging. Prerequisite for drift checks: set one of ANTHROPIC_API_KEY or CURSOR_API_KEY as a repo secret. Without it, the drift job fails fast with a clear error. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Drift review against main found no spec-relevant changes: the three new base commits are OAS-regenerated outputs (*.gen.go, goldens) and README cleanup; the generator, credential-resolution, http-client, oauth and output-contract behavior the specs model is unchanged. All six specs pass allium check 3.5.0 with 0 errors. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Consolidated onto this branch rather than opening a new PR. Corrects spec-vs-code divergence, fills gaps, adds surfaces/contracts, and records unresolved intent as open questions. allium check: 0 errors.
The gate grepped for an "N error(s)" summary. allium 3.5.0 and 3.5.3 emit JSON and never print that string, so the job failed unconditionally, independent of spec content -- verified directly against both binaries. The raw exit code cannot replace the grep either: "allium check --help" documents exit 1 as "one or more errors OR WARNINGS were reported", and specs carry unavoidable warnings (externalEntity.missingSourceHint, use.unresolvedPath). Gating on the exit code would keep CI red for content-free reasons -- exactly what the original comment set out to avoid. The gate now parses diagnostics and fails only on severity == error. allium emits one JSON document per spec file, concatenated, so the stream is slurped with "jq -s". The legacy text summary is retained as a fallback because runner caches are not uniform across repos. If neither format parses, the job fails loudly rather than reporting green. Verified against real output: forex 0 err / 2 warn PASS, banking 0/7 PASS, cli 0/0 PASS, data-warehouse 4 err FAIL, unparseable input FAIL.
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.
Behavioral Specifications
Machine-distilled from source code using allium-spec-distillation.
credential-resolutionReview notes:
oauth-flowReview notes:
http-clientReview notes:
output-contracthand-authored-commandscode-generatorReview notes:
🤖 Generated with allium-spec-distillation
Added: fix for this PR's own Allium Check gate
This PR introduces
.github/workflows/allium-check.yml. That workflow's gate was broken, so a commit has been added here to fix it rather than opening a separate PR.What was wrong. The gate ran
allium checkand then grepped its output for anN error(s)summary line to decide pass/fail. allium 3.5.0 and 3.5.3 emit JSON and never print that string, so the grep matched nothing, the script hit its owncould not parse allium check summarybranch, and the job failed unconditionally — independently of spec content. Every Allium Check run across the org has been red since 2026-07-22 for this reason.Why the exit code alone is not the fix.
allium check --helpdocuments exit 1 as "One or more errors or warnings were reported". Specs carry warnings that cannot be removed (externalEntity.missingSourceHint, anduse.unresolvedPathfor shared-library imports, which allium 3.5.x cannot resolve locally at all). Gating on the exit code would keep this job red for reasons unrelated to correctness — which is exactly what the original code comment was trying to avoid.What it does now. Parses the diagnostics and fails only on
severity == "error". allium emits one JSON document per spec file, concatenated, so the stream is slurped withjq -srather than read as a single object. The older human-readable summary is still accepted as a fallback, because runner caches are not uniform across repos. If neither format parses, the job fails loudly — a gate that cannot read its own input must never report green.Verified by running both allium 3.5.0 and 3.5.3 against real specs in this org: 0 errors + warnings → PASS (previously FAIL), specs with real errors → FAIL, unparseable input → FAIL.
git merge-tree, no merge performed), so the distance alone is not a conflict — it is noted here so a reviewer does not have to work that out.The spec content of this PR is unchanged by that commit; it touches only the workflow file.