Totem Shield
Version updated for https://github.com/mmnto-ai/totem to version @mmnto/totem@1.15.4.
- This action is used across all versions by 0 repositories.
Action Type
This is a Composite action.
Go to the GitHub Marketplace to find the latest changes.
Action Summary
Totem is a CLI tool designed to provide a persistent memory and enforcement layer for AI coding agents, ensuring architectural integrity across repositories. It automates the process of converting plain-English lessons about coding mistakes into enforceable linting rules, which are applied locally and offline to prevent recurring errors during development workflows. By acting as a “tripwire,” Totem addresses challenges like context loss and redundant mistakes, enhancing collaboration between AI agents and human developers without relying on runtime large language models (LLMs).
What’s Changed
Patch Changes
d295439: 1.15.4 bundles two compile-worker prompt classifier improvements that surfaced from downstream consumer friction on
mmnto-ai/liquid-city. Both close fidelity gaps between the lesson prose authors wrote and the compiled rule that shipped.Test-contract scope classifier (closes #1626)
- New
### Test-Contract Scope Classifier (mmnto-ai/totem#1626)section on bothCOMPILER_SYSTEM_PROMPTandPIPELINE3_COMPILER_PROMPT. Teaches the compile-worker to recognize lessons whose hazard is behavior inside test files (assertion conventions, spy / mock contracts, test-fixture hygiene) and emit test-inclusivefileGlobsinstead of the default!**/*.test.*exclusion. - Three positive signals classify a lesson as test-contract: the
testingtag, test-framework calls inbadExample/goodExample(describe(,it(,test(,expect(,vi.mock(,jest.mock(,beforeEach(,afterEach(,vi.spyOn(,jest.spyOn(), or lesson-body references to test-execution-specific behavior. - Broad test-inclusive glob set for test-contract rules:
["**/*.test.*", "**/*.spec.*", "**/tests/**/*.*", "**/__tests__/**/*.*"]. Narrow test-scoped globs (e.g.,packages/e2e/**/*.spec.ts) are preserved when the lesson clearly targets them. - False-positive trap guard: the word “contract” alone does NOT classify a lesson as test-scoped. Lessons titled “Define strict API Data Contracts” or “Versioning contracts for REST endpoints” describe application-surface invariants. Classification requires the
testingtag OR test-framework code in the examples alongside any keyword match.
Downstream impact: Two
liquid-cityrules ("Normalize temp paths for cross-platform equality","Spy on logger contracts in tests") were shipping with scopes that excluded tests and silently never fired. A follow-up chore cycle (totem compile --upgrade <hash>per rule) retriages existing corpus against the new prompt.Declared severity override (closes #1656)
- New
parseDeclaredSeverity(body: string)helper exported from@mmnto/totem. Parses**Severity:** error/Severity: warningprose declarations from a lesson body and returns a normalized'error' | 'warning' | undefined. Tolerates common markdown and punctuation shapes: bold markers (**,*,_) on either side, backtick-wrapped values, trailing sentence punctuation (.,,,;,:,!,?), and combined shapes like**Severity: error**.. Strict enum equality follows the strip, so out-of-vocabulary tokens (info,critical) returnundefined. buildCompiledRulehonors a newdeclaredSeverityOverrideoption onBuildCompiledRuleOptions. Post-LLM override wins overparsed.severityregardless of LLM emission. Marker fires inBuildRuleResult.severityOverrideonly when the override actually changed the outcome (declared value differs fromemittedSeverity ?? 'warning'). Marker is threaded through rejection paths too, so telemetry captures prompt-drift even when the rule fails for other reasons.- New
onSeverityOverridecallback onCompileLessonCallbacksfires when the override changes the emitted severity. CLIcompile.tswires awriteSeverityOverrideTelemetryclosure that appends records taggedtype: 'severity-override'to.totem/temp/telemetry.jsonlvia the cwd-awaretotemDir(matches themmnto-ai/totem#1645pattern). Fire-and-forget; sink failures do not interfere with compile results. - New
### Declared Severity (mmnto-ai/totem#1656)directive section on both compile prompts instructs the LLM to honor prose-declared severity in its emitted JSON. Every Output Schema example and every concrete Lesson → Output few-shot example now carries"severity": "warning"(the default) to reduce drift at source.
Downstream impact: Five
liquid-cityADR-008 rules on PR 77 burned ~10 manual severity-edit commits across R2 + R3 rounds because the compile pipeline emitted"severity": "warning"despite lesson prose declaringSeverity: error. The mechanical re-edit loop closes; the nexttotem lesson compilecycle on LC emits declared severity directly.Strategy submodule bump
.strategysubmodule pointer advances from113179cto7892892b. Picks up strategy PR #125 (upstream-feedback items 015 + 016 from liquid-city session-17) and strategy PR #124 (upstream-feedback item 017 — three-layer language support gap addendum that documents the architectural surface of the pending Rust-support arc).
- New