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
{{ message }}
Repository navigation
Commit ef6dec9
Browse filesBrowse the repository at this point in the historyBrowse files
fix(java): the agent-context staleness nudge compared two version lines, so it fired forever (#347)
meta agent-docs COPIES the agent-instruction files into a consuming repo; it does not
link. The copy freezes at whatever version wrote it and a dependency bump never touches
it, so an agent reads old instructions and authors vocabulary the current loader rejects.
The staleness advisory exists to break that silence.
On the JVM it could never fire correctly. generatedBy is always an NPM version, because
meta agent-docs is the canonical scaffolder for every port and the others redirect to it.
installedVersion() reads the MAVEN artifact version, which carries a historical major of 7
by design. The comparison is exact equality -- deliberately, so prerelease drift still
nudges -- so "7.24.1".equals("0.24.1") was false and always would be. The nudge fired on
every mvn metaobjects:generate forever, including when the context was perfectly in sync.
Not silent: permanently loud, which carries the same signal and is tuned out faster.
C# and Python were never affected; both read a version on the 0.x line. Java and Kotlin
are the broken pair, and only because the Maven major is deliberately different. This is
the two-version-lines contract biting somewhere nobody looked.
The fix is in the COORDINATE, not the comparison. stalenessAcrossVersionLines reduces both
sides to the release they name and keeps the equality EXACT, so every property the original
contract defends survives -- an RC-scaffolded context against a final release still nudges,
and the message still names both real versions. staleness() is untouched; its javadoc
forbids relaxing it into a semver compare and is right.
Correct while the four registries share a minor.patch. That is the documented lockstep rule
and is already relied on by scripts/prerelease.mjs:210 and scripts/release-verify.mjs:27,
which both build the Maven version as `7.` + npm's remainder -- so this reuses a convention
rather than inventing one, and is a third site for it rather than a first. It is a
convention and not a gate; if lockstep ever breaks this reports in-sync across a real gap.
That trade is accepted and stated in the javadoc, because it is strictly better than a
check that can never match.
Why it survived: every existing test used a generatedBy of "7.2.1" -- a shape production
CANNOT produce, since only the Node CLI writes that field. The fixtures asserted a world
where both operands sat on the Maven line, so the pure function looked correct while the
deployed comparison was never exercised once. Six cases now use the real shape, including
the in-sync case that is the whole point.
Option A of four, chosen after a two-arm adjudication that converged independently on it.
Rejected: comparing metamodelVersion instead -- it is identical across ports by
construction, but 91 commits touched agent-context/skills/ in 90 days against 5 distinct
values of that constant in the project's whole history, so its blind spot is dominant
rather than marginal. Rejected: stamping every port's line into the manifest -- the Node
scaffolder cannot know a consumer's Maven version. Rejected: a content digest -- the
manifest does carry per-file hashes, but they exist to detect hand-edits, and the JVM
ships no skill content at all, so the port with the bug cannot compute the current side.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NynrRND6ZUwGvq3ZUTCfxG
Copy file name to clipboardExpand all lines: CHANGELOG.md
+38Lines changed: 38 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,44 @@ this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
7
7
8
8
## [Unreleased]
9
9
10
+
### Fixed — the JVM agent-context staleness nudge compared two different version lines, so it fired forever ([#347](https://github.com/metaobjectsdev/metaobjects/issues/347))
11
+
12
+
`meta agent-docs`**copies** the agent-instruction files into a consuming repo; it does not
13
+
link. So the copy freezes at whatever version wrote it and a dependency bump never touches it —
14
+
an agent then reads old instructions and authors vocabulary the current loader rejects. A
15
+
staleness advisory exists in all four ports to break that silence, and on `gen`/`verify` it
16
+
compares the version that scaffolded the context against the installed one.
17
+
18
+
**On the JVM those are two different version lines and can never be equal.**`generatedBy` is
19
+
always an **npm** version, because `meta agent-docs` is the canonical scaffolder for every port
20
+
and the others redirect to it. `AgentContextScaffold.installedVersion()` reads the **Maven**
21
+
artifact version, which carries a historical major of `7` by design. The comparison is exact
22
+
equality — deliberately, so prerelease drift still nudges — so `"7.24.1".equals("0.24.1")` was
23
+
false and always would be. The nudge fired on **every `mvn metaobjects:generate`, in
24
+
perpetuity, including when the context was perfectly in sync.** Not silent: permanently loud,
25
+
which carries the same amount of signal and gets tuned out faster.
26
+
27
+
C# and Python were never affected — both read a version on the `0.x` line. **Java and Kotlin
28
+
are the broken pair**, and only because the Maven major is deliberately different.
29
+
30
+
**The fix is in the coordinate, not the comparison.**`stalenessAcrossVersionLines` reduces both
31
+
sides to the release they name (`7.24.1` and `0.24.1` both → `24.1`) and keeps the equality
32
+
EXACT, so every property the original contract defends survives — an RC-scaffolded context
33
+
against a final release still nudges. The message still names both real versions. The plain
34
+
`staleness` is untouched; its javadoc forbids relaxing it into a semver compare and is right.
35
+
36
+
Correct while the four registries share a `minor.patch` — the documented lockstep rule, already
37
+
relied on by `scripts/prerelease.mjs` and `scripts/release-verify.mjs`, which both build the
38
+
Maven version as `7.` + npm's remainder. It is a convention rather than a gate, and that is the
39
+
accepted trade: reporting in-sync across a hypothetical future gap is strictly better than a
40
+
check that can never match.
41
+
42
+
**Why it survived:** the existing tests used a `generatedBy` of `"7.2.1"` — a **shape production
43
+
cannot produce**, since only the Node CLI writes that field. The fixture asserted a world where
44
+
both operands were on the Maven line, so the pure function looked correct and the deployed
45
+
comparison was never exercised. Six regression cases now use the real shape.
46
+
47
+
10
48
### Added — a retired capability gets its status back: `@status: retired` (FR-039)
11
49
12
50
`@status` gains a fourth member, **`retired`**, and `@supersededBy` is registered again — this
0 commit comments