You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(python): agent-context staleness nudge in gen/verify
Port the TS agent-context staleness advisory to the Python port. When an
adopter upgrades MetaObjects but does not re-scaffold the copied-in
.claude/skills agent context, `metaobjects gen`/`verify` now print ONE
stderr line nudging a re-scaffold.
Three parts (mirrors server/typescript/packages/sdk/src/agent-context/scaffold.ts):
1. Stamp `generatedBy` (SAME key as TS — polyglot cross-read) into the
.metaobjects/.agent-context.json manifest when `agent-docs` scaffolds it.
Version resolved via importlib.metadata.version("metaobjects"), falling
back to "0.0.0" on PackageNotFoundError (mirrors the TS fallback).
2. Pure decision `agent_context_staleness(manifest, current_version)`: no
manifest -> None; generatedBy == current -> None (exact equality on
purpose — any drift nudges, never a semver compare); differs/absent -> a
one-line message naming both versions + the Python refresh command
('metaobjects agent-docs'). Unit-testable, no FS.
3. gen + verify read <cwd>/.metaobjects/.agent-context.json near their start
and print the message to stderr if stale. Advisory only: never raises,
never changes the exit code, never writes; missing/corrupt manifest is
silently ignored.
The manifest is not in the byte-gated assembled file set, so adding
generatedBy leaves agent-context conformance goldens unchanged.
Tests: pure decision (none/equal/differ/absent), the stamp, and gen+verify
stderr wiring (stale -> nudge + exit 0; absent/corrupt -> silent).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments