@agentskit/doc-bridge 1.10.0 → 1.10.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.10.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 0926c57: Keep a committed index fresh across commits.
8
+
9
+ The retrieval projection sealed its content hash over the discovery snapshot's hash, and a
10
+ snapshot's hash covers its `sourceRevision` — the commit SHA when the working tree is clean, a
11
+ digest of the scanned files when it is not. That is right for an artifact whose job is to say what
12
+ one revision looked like, and wrong as a projection input: the projection is a function of what the
13
+ snapshot observed, not of where it observed it.
14
+
15
+ The consequence only appears in a repository that commits `.doc-bridge/index.json`, which is the
16
+ recommended setup: committing the index changes the revision that the next run hashes, so the
17
+ artifact was stale the moment it landed — landing it is a commit. `ak-docs gate run` reported
18
+ `index-freshness` failing on an index that nothing had invalidated, and no regenerate could fix it,
19
+ because the fix was itself a commit. Dogfooding on a 25-package monorepo, the gate could not be
20
+ made to pass twice in a row.
21
+
22
+ The seal is now over what the snapshot observed: the entities, the relations and the analyzer
23
+ identity that produced them, alongside the overlay and configuration hashes it already covered. The
24
+ artifact still carries `snapshotHash`, now documented as provenance rather than a seal input, so a
25
+ reader can still say which snapshot a projection came from. `RETRIEVAL_PROJECTION_VERSION` goes to
26
+ 2, so no reader compares a hash across the change, and every index's content hash changes once on
27
+ the next `ak-docs index`.
28
+
3
29
  ## 1.10.0
4
30
 
5
31
  ### Minor Changes
package/action.yml CHANGED
@@ -20,7 +20,7 @@ inputs:
20
20
  package-version:
21
21
  description: Exact @agentskit/doc-bridge npm version (kept in sync with this Action release)
22
22
  required: false
23
- default: '1.10.0'
23
+ default: '1.10.1'
24
24
 
25
25
  runs:
26
26
  using: composite
@@ -3616,8 +3616,13 @@ var RetrievalIndexV1Schema = z5.object({
3616
3616
  schemaVersion: z5.literal(RETRIEVAL_INDEX_SCHEMA_VERSION),
3617
3617
  contentHash: hash2,
3618
3618
  contentHashAlgo: z5.literal("sha256-normalized-v1"),
3619
- /** The three inputs the projection is a function of. Same three hashes, same projection. */
3619
+ /**
3620
+ * Which snapshot this was projected from. Provenance, not a seal input: it carries the
3621
+ * snapshot's `sourceRevision`, and the projection is a function of what the snapshot observed
3622
+ * rather than of the revision it was observed at.
3623
+ */
3620
3624
  snapshotHash: hash2,
3625
+ /** The inputs the projection is a function of. Same hashes, same projection. */
3621
3626
  overlayHash: hash2,
3622
3627
  configurationHash: hash2,
3623
3628
  lexiconVersion: z5.number().int().nonnegative().max(1e3),
@@ -4055,7 +4060,7 @@ var buildLookup = (config, packages, corpus, indexOutFile, humanDocs = {}, root
4055
4060
  };
4056
4061
 
4057
4062
  // src/version.ts
4058
- var PACKAGE_VERSION = "1.10.0";
4063
+ var PACKAGE_VERSION = "1.10.1";
4059
4064
 
4060
4065
  // src/index-builder/capabilities.ts
4061
4066
  var renderCapabilitiesJson = (config, index, paths) => {
@@ -5633,7 +5638,7 @@ var resolveSearchParams = (configured) => ({
5633
5638
  });
5634
5639
 
5635
5640
  // src/retrieval/project.ts
5636
- var RETRIEVAL_PROJECTION_VERSION = 1;
5641
+ var RETRIEVAL_PROJECTION_VERSION = 2;
5637
5642
  var DOCUMENT_BODY_LIMIT = 4e3;
5638
5643
  var MAX_EDGES = 64;
5639
5644
  var MAX_ALIASES = 32;
@@ -5641,6 +5646,12 @@ var MAX_TAGS = 32;
5641
5646
  var MAX_SYMBOLS = 256;
5642
5647
  var MAX_SUMMARY = 400;
5643
5648
  var EMPTY_OVERLAY_HASH = sha256NormalizedV1({ accepted: [] });
5649
+ var snapshotObservationHash = (snapshot) => sha256NormalizedV1({
5650
+ pipelineVersion: snapshot.pipelineVersion,
5651
+ analyzerVersions: snapshot.analyzerVersions,
5652
+ entities: snapshot.entities,
5653
+ relations: snapshot.relations
5654
+ });
5644
5655
  var CONFIDENCE_RANK = { observed: 0, declared: 1, fuzzy: 2, proposed: 3 };
5645
5656
  var weakerConfidence = (a, b) => CONFIDENCE_RANK[a] >= CONFIDENCE_RANK[b] ? a : b;
5646
5657
  var relationConfidence = (relation) => relation.metadata?.confidence === "fuzzy" ? "fuzzy" : relation.provenance;
@@ -5901,7 +5912,7 @@ var projectRetrievalIndex = (options) => {
5901
5912
  };
5902
5913
  const contentHash = sha256NormalizedV1({
5903
5914
  projectionVersion: RETRIEVAL_PROJECTION_VERSION,
5904
- snapshotHash: base.snapshotHash,
5915
+ observationHash: snapshotObservationHash(snapshot),
5905
5916
  overlayHash: base.overlayHash,
5906
5917
  configurationHash: base.configurationHash,
5907
5918
  lexiconVersion: base.lexiconVersion,