Skip to content

Restore provider reputation across reconnects by verified identity - #4

Merged
numinousmuses merged 1 commit into
masterfrom
forge/task-66257843079c685ec7a310c33395c780
Sep 6, 2026
Merged

numinousmuses merged 1 commit into
masterfrom
forge/task-66257843079c685ec7a310c33395c780

Conversation

@numinousmuses

@numinousmuses numinousmuses commented Sep 5, 2026 •

Copy link
Copy Markdown

Restore a reconnecting provider’s persisted reputation using its freshly verified Secure Enclave key. The old startup snapshot missed work earned after startup and matched serial numbers across different signing keys.

The fix looks up current device metadata and earned reputation separately, excludes the registering session, and uses deterministic ordering in both memory and PostgreSQL stores. Fresh attestation still determines trust. Store lookup results are copied so callers cannot mutate persisted state.

Validation:

  • The accepted reconnect regression fails on the original commit and passes with this change.
  • Fresh workers run the API, registry, and store race suites against a real isolated PostgreSQL database, plus docs checks.
  • Added cases cover missing reputation, repeated reconnects, separate metadata/reputation donors, deterministic timestamp ties, and memory isolation.
  • An independent review found a donor-selection flaw in the first candidate. Forge recorded the feedback, ran a second implementation attempt, and verified this revised candidate.

Issue-repair demonstration for Numinous Forge, addressing upstream issue Layr-Labs#747 in this fork. This does not close or modify the upstream issue. CI separately verifies the PR merged with the current default branch before merge.

This change was prepared by Numinous Forge and independently verified on a fresh worker.

Task: 66257843079c685ec7a310c33395c780
Base: bbf6f83d4bbe66ae1a78c8f5cec898e3fbff5783
Verified tree: d48f7ad10dae36a444610f59abca9c04d1b4862d
Policy: 6e7f097750c960348238b82c6517482d1698c8bb0785146572e36cae2ea127b8
Verification runs: e91b2033757f947a1bada3f051595966, 99250d1942a1c89a834647def5c64341, 88768ed2c0a93307867b7b43f9e5492e

Export full evidence with numinous-forge task export 66257843079c685ec7a310c33395c780 ./evidence.

Before:

flowchart LR
  R[Provider reconnect] --> V[verifyProviderAttestation]
  V --> S[Server.storedProviders startup snapshot]
  S --> M[Serial-number match]
  M --> L[Recent reputation missing or different signing identity selected]
Loading

After:

flowchart LR
  R[Provider reconnect] --> V[verifyProviderAttestation verifies SE key]
  V --> M[GetProviderBySEKey selects newest device metadata]
  M --> S[RestoreProviderState]
  S --> P[GetReputationBySEKey selects latest earned reputation]
  P --> C[Exclude current session; deterministic ordering; copied records]
  C --> O[Restore standing and account linkage; re-earn trust live]
Loading

Verified tree: d48f7ad
Policy: 6e7f097750c960348238b82c6517482d1698c8bb0785146572e36cae2ea127b8
@numinousmuses
numinousmuses marked this pull request as ready for review September 6, 2026 00:30
@numinousmuses
numinousmuses merged commit 9ad2aa1 into master Sep 6, 2026
2 of 3 checks passed
@numinousmuses

Copy link
Copy Markdown
Author

Numinous Forge · Engineering task

Change published

The independently verified candidate is available for review. PR CI is reported separately.

Checks passed: Reconnect regression, Coordinator, Documentation.

Revision: c5bdd4230beb.

Open pull request · Task 66257843079c685ec7a310c33395c780

Last observed 2026-09-06 05:37 UTC. This comment updates as work progresses.

@numinousmuses

Copy link
Copy Markdown
Author

Numinous Forge · Change and verification

Result: repaired and merged into this fork. Addresses the reconnect behavior reported in upstream issue Layr-Labs#747.

What was wrong: A reconnecting provider could lose reputation earned since the coordinator started. Matching by serial number could also restore another signing identity's history.

What changed: Restore current saved history using the provider's freshly verified Secure Enclave key. Device metadata and earned reputation are selected separately, and the new session cannot overwrite the history being restored.

What we proved:

  • The original code fails the reconnect regression; the repaired code passes.
  • Both memory and real PostgreSQL tests cover identity matching, separate history records, repeated reconnects, timestamp ties, and protection against accidental mutation.
  • Independent candidate verification passed. PR CI also passed coordinator, protocol, and documentation checks on the proposed merge.

Review changed the result: The first candidate passed its initial tests, but review found a history-selection flaw. We fed that finding back into the task, revised the fix, and added checks before accepting it.

Review focus: Confirm which saved record should supply device metadata versus reputation. Fresh attestation still determines trust; reconnecting does not inherit trust from an old session.

Read the code changes · See the deliberately failing example

Review summary for c5bdd4230beb. Live task and CI progress are reported separately.

@numinousmuses numinousmuses added the trigger:instructed Work was explicitly requested; generated PRs inherit this trigger. label Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

trigger:instructed Work was explicitly requested; generated PRs inherit this trigger.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant