Repository navigation
feat: add edition guard CI and frozen 2026 fixtures - #17
Conversation
Sam PR ReviewVerdict: The PR introduces a comprehensive edition guard workflow, documentation, and test fixtures. All added code follows repository conventions, and the tests cover the new functionality. No bugs or security issues were identified. Advisory review generated by Sam with Groq. It does not approve or block the pull request; |
302eb44 to
71004dc
Compare
Sam Edition GuardRisk: The added test file does not modify the compiler, parser, lexer, or codegen logic and therefore introduces no new syntax or breaking changes for edition 2026 programs. Recommendation: No action required; the change is backward compatible. Generated by Sam with Groq from the compiler diff. Deterministic fixture compilation always runs; this audit is advisory unless it reports an edition 2026 impact. |
- add tests/editions/2026 fixtures: a default-edition basic agent and an explicit edition "2026" program with strict_schema, multiple agents, template interpolation, and !res.ok handling - add ci/sam/edition-guard.sb, a Sam flow that audits compiler diffs for edition 2026 compatibility and returns an EditionAudit schema - add .github/workflows/edition-guard.yml: deterministic fixture compilation on every matching PR, plus a Groq-backed audit when the secret is available that comments on the PR and fails on edition impact - add package-level fixture tests so bun test parses and compiles every frozen fixture and the guard flow as edition 2026 - document editions and the guard in the README
71004dc to
f857634
Compare
|
Checked the finding. To make the dependency explicit rather than implicit, A unit test for locating a workflow-only binary is not applicable here; the workflow run is the deterministic check for it. |
Summary
Adds an edition governance pipeline for
@sam-lang/compiler, dogfooding Sam for the advisory audit, plus deterministic frozen-fixture validation foredition "2026".Deliverables
Frozen fixtures (
tests/editions/2026/)basic-agent.sb— noeditionheader, validating the2026default with a provider, schema, agent, andflow main.explicit-edition.sb— explicitedition "2026",strict_schema: true, multiple agents, template interpolation, and!res.okhandling.Sam audit flow (
ci/sam/edition-guard.sb)edition "2026", Groq provider withenv()base URL/key andstrict_schema: true.EditionAuditschema withintroduces_breaking_syntax,affects_edition_2026,risk_level,summary, andrecommendation.LanguageArchitectagent onopenai/gpt-oss-20bwithreasoning_effort: "medium",max_tokens: 1000,timeout: 30,retries: 2, and a prompt that treats the diff as untrusted and checks for keyword collisions, silent default changes, and ungated stricter rules.flow main(compiler_diff: string)returns the error result on!res.ok, otherwise the audit value.Workflow (
.github/workflows/edition-guard.yml)pull_requestforpackages/compiler/**,tests/editions/**, andci/sam/edition-guard.sb.contents: read,pull-requests: write.GROQ_API_KEY: buildsgit diff origin/<base>...HEAD -- packages/compiler/, truncates to 24,000 bytes, runs the guard flow, validates the JSON with Bun, posts or updates a single marked comment, and fails the job whenaffects_edition_2026istrue.Tests and docs
packages/compiler/src/editionFixtures.test.tsparses and compiles every frozen fixture and the guard flow, assertingast.edition === "2026".Verification
bun test: 140 pass, 1 skip, 0 failbun run typecheck: no errorssam compileandsam astsucceed fortests/editions/2026/*.sbandci/sam/edition-guard.sb