@agenticprimitives/contracts 1.0.0-alpha.5 → 1.0.0-alpha.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agenticprimitives/contracts",
3
- "version": "1.0.0-alpha.5",
3
+ "version": "1.0.0-alpha.6",
4
4
  "description": "Solidity contracts + ABIs + flattened sources + per-network deployment addresses for the agenticprimitives stack.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -121,29 +121,36 @@ contract GeoFeatureRegistry {
121
121
  }
122
122
 
123
123
  version = prevVer + 1;
124
- _records[p.featureId][version] = FeatureRecord({
125
- featureId: p.featureId,
126
- version: version,
127
- stewardAccount: p.stewardAccount,
128
- featureKind: p.featureKind,
129
- geometryHash: p.geometryHash,
130
- coverageRoot: p.coverageRoot,
131
- sourceSetRoot: p.sourceSetRoot,
132
- metadataURI: p.metadataURI,
133
- centroidLat: p.centroidLat,
134
- centroidLon: p.centroidLon,
135
- bboxMinLat: p.bboxMinLat,
136
- bboxMinLon: p.bboxMinLon,
137
- bboxMaxLat: p.bboxMaxLat,
138
- bboxMaxLon: p.bboxMaxLon,
139
- validAfter: p.validAfter,
140
- validUntil: p.validUntil,
141
- active: true,
142
- registeredAt: uint64(block.timestamp)
143
- });
144
124
  latestVersion[p.featureId] = version;
145
125
  if (prevVer == 0) _allFeatures.push(p.featureId);
126
+ // The heavy record write + event live in a helper so `publish`'s own stack stays shallow.
127
+ _storeAndEmit(p, version);
128
+ }
146
129
 
130
+ /// @dev Writes the record FIELD-BY-FIELD to storage (no in-memory struct literal) and emits.
131
+ /// Behaviour is identical to the prior `_records[...] = FeatureRecord({...})` literal; the
132
+ /// split exists only to keep `publish` within solc's stack under `forge coverage --ir-minimum`
133
+ /// instrumentation (the 18-field memory literal + a dynamic `string` overflowed it by one slot).
134
+ function _storeAndEmit(PublishInput calldata p, uint64 version) internal {
135
+ FeatureRecord storage r = _records[p.featureId][version];
136
+ r.featureId = p.featureId;
137
+ r.version = version;
138
+ r.stewardAccount = p.stewardAccount;
139
+ r.featureKind = p.featureKind;
140
+ r.geometryHash = p.geometryHash;
141
+ r.coverageRoot = p.coverageRoot;
142
+ r.sourceSetRoot = p.sourceSetRoot;
143
+ r.metadataURI = p.metadataURI;
144
+ r.centroidLat = p.centroidLat;
145
+ r.centroidLon = p.centroidLon;
146
+ r.bboxMinLat = p.bboxMinLat;
147
+ r.bboxMinLon = p.bboxMinLon;
148
+ r.bboxMaxLat = p.bboxMaxLat;
149
+ r.bboxMaxLon = p.bboxMaxLon;
150
+ r.validAfter = p.validAfter;
151
+ r.validUntil = p.validUntil;
152
+ r.active = true;
153
+ r.registeredAt = uint64(block.timestamp);
147
154
  emit FeaturePublished(p.featureId, version, p.stewardAccount, p.featureKind, p.geometryHash, p.coverageRoot, p.sourceSetRoot, p.metadataURI);
148
155
  }
149
156
 
@@ -116,24 +116,30 @@ contract SkillDefinitionRegistry {
116
116
 
117
117
  version = prevVer + 1;
118
118
  bytes32 predecessorRoot = prevVer == 0 ? bytes32(0) : _records[p.skillId][prevVer].ontologyMerkleRoot;
119
-
120
- _records[p.skillId][version] = SkillRecord({
121
- skillId: p.skillId,
122
- version: version,
123
- stewardAccount: p.stewardAccount,
124
- skillKind: p.skillKind,
125
- conceptHash: p.conceptHash,
126
- ontologyMerkleRoot: p.ontologyMerkleRoot,
127
- predecessorRoot: predecessorRoot,
128
- metadataURI: p.metadataURI,
129
- validAfter: p.validAfter,
130
- validUntil: p.validUntil,
131
- active: true,
132
- registeredAt: uint64(block.timestamp)
133
- });
134
119
  latestVersion[p.skillId] = version;
135
120
  if (prevVer == 0) _allSkills.push(p.skillId);
121
+ // The heavy record write + event live in a helper so `publish`'s own stack stays shallow.
122
+ _storeAndEmit(p, version, predecessorRoot);
123
+ }
136
124
 
125
+ /// @dev Writes the record FIELD-BY-FIELD to storage (no in-memory struct literal) and emits.
126
+ /// Behaviour is identical to the prior `_records[...] = SkillRecord({...})` literal; the split
127
+ /// exists only to keep `publish` within solc's stack under `forge coverage --ir-minimum`
128
+ /// instrumentation (the memory struct literal + a dynamic `string` overflowed it by one slot).
129
+ function _storeAndEmit(PublishInput calldata p, uint64 version, bytes32 predecessorRoot) internal {
130
+ SkillRecord storage r = _records[p.skillId][version];
131
+ r.skillId = p.skillId;
132
+ r.version = version;
133
+ r.stewardAccount = p.stewardAccount;
134
+ r.skillKind = p.skillKind;
135
+ r.conceptHash = p.conceptHash;
136
+ r.ontologyMerkleRoot = p.ontologyMerkleRoot;
137
+ r.predecessorRoot = predecessorRoot;
138
+ r.metadataURI = p.metadataURI;
139
+ r.validAfter = p.validAfter;
140
+ r.validUntil = p.validUntil;
141
+ r.active = true;
142
+ r.registeredAt = uint64(block.timestamp);
137
143
  emit SkillPublished(p.skillId, version, p.stewardAccount, p.skillKind, p.conceptHash, p.ontologyMerkleRoot, predecessorRoot, p.metadataURI);
138
144
  }
139
145