Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion PG-PROFILE-51-REPORT.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ tail:

The completed profile receipt recorded 1,034 files; that historical receipt
is unchanged. The template equivalence registry is a different measure:
159 eligible plus 37 cold-required files, for **196** total. The
162 eligible plus 37 cold-required files, for **199** total. The
handle-generation, issuance-cutover, opaque-cursor and search-index repair
tests remain registered. These counts are recomputed from the merged registry arrays.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,14 @@ export interface AsPolyfillConnectorRegisterDependencies {
* whether or not that version is still current; null when none was recorded.
*/
getAcceptedDeclarationDigest: (connectorId: string, version: string) => Promise<string | null> | string | null;
/** Produces the exact representation `registerConnector` persists, and its storage key. */
normalizeManifestForStorage: (manifest: Record<string, unknown>) => {
/**
* Produces the exact representation `registerConnector` persists, and its storage key. `context` carries
* the declaration already retained for the connector, when there is one.
*/
normalizeManifestForStorage: (
manifest: Record<string, unknown>,
context: { retainedSourceDeclaration?: unknown }
) => {
connectorId: string;
storedManifest: Record<string, unknown>;
};
Expand Down Expand Up @@ -100,7 +106,13 @@ export async function executeAsPolyfillConnectorRegister(
// equivocation and the previously accepted content is retained. Same
// content is an idempotent re-registration; a new version is a new key.
deps.validateManifest(manifest as Record<string, unknown>);
const { connectorId, storedManifest } = deps.normalizeManifestForStorage(manifest as Record<string, unknown>);
// The candidate is projected under the identity the stored row already holds, exactly as registerConnector
// does. Without it, a manifest that names no source would be refused on the fresh path.
const retained = await acceptedManifestFor(deps, connectorKey);
const { connectorId, storedManifest } = deps.normalizeManifestForStorage(
manifest as Record<string, unknown>,
retained?.source_declaration === undefined ? {} : { retainedSourceDeclaration: retained.source_declaration }
);
const version = storedManifest.version;
const incomingDigest = deps.declarationDigest(storedManifest);
let acceptedDigest: string | null = null;
Expand Down
Loading
Loading