fix: hash hostname in fingerprint, portable validation paths, remove dead code#26
fix: hash hostname in fingerprint, portable validation paths, remove dead code#26onthebigtree wants to merge 1 commit intoEvoMap:mainfrom
Conversation
…ove dead code
Three independent improvements:
1. Hash hostname before storing in envFingerprint (envFingerprint.js)
os.hostname() was stored verbatim in every Capsule and EvolutionEvent,
which are published to the public Hub. sanitize.js does not redact
hostnames (no matching pattern), so strings like 'john-macbook-pro.local'
leaked into the public feed. Replace with a 12-char SHA-256 prefix so
the value still uniquely identifies the environment class without
revealing the machine name.
2. Remove absolute paths from buildValidationCmd (assetStore.js)
The previous implementation resolved modules via path.resolve(__dirname)
at call time, embedding the current machine's absolute path (e.g.
/Users/xxx/codespace/evolver/src/evolve) into Gene validation commands
stored in genes.json. Two consequences:
- sanitize.js redacts /Users/... in published capsules, corrupting the
stored validation command for any consumer.
- Moving the project directory breaks all previously stored Gene
validation commands.
runValidations() already executes with cwd=repoRoot, so switching to
require('./src/evolve') style relative paths is correct and portable.
3. Remove appendCapsule dead code (assetStore.js, solidify.js)
appendCapsule was exported and imported by solidify.js but never called
(solidify uses upsertCapsule exclusively). It also lacked deduplication,
so any accidental call would grow capsules.json unboundedly. Removed the
function, its export, and the unused import in solidify.js.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| appendEventJsonl, appendCandidateJsonl, appendExternalCandidateJsonl, | ||
| readRecentCandidates, readRecentExternalCandidates, | ||
| upsertGene, appendCapsule, upsertCapsule, | ||
| upsertGene, upsertCapsule, |
There was a problem hiding this comment.
Removed appendCapsule still called in scripts
High Severity
appendCapsule was removed from assetStore.js exports and its definition was deleted, but scripts/a2a_promote.js line 78 still calls assetStore.appendCapsule(promoted). This causes a TypeError: assetStore.appendCapsule is not a function crash when the promote script attempts to promote a Capsule. The call site likely needs to be updated to use upsertCapsule instead.
|
Thank you for the contribution! The hostname hashing and portable validation paths fixes are excellent and have been applied. However, the Could you update the PR to either:
Once that is fixed, we can merge. The other two changes (hostname hash + portable paths) have already been applied internally. Thanks again for the thoughtful review! |
|
Closing this PR as the valuable changes have already been incorporated:
The Thank you @onthebigtree for the thoughtful contributions! Both your PRs (#25 and #26) have meaningfully improved the codebase. You are credited as a contributor. |
- PR #68 (hendrixAIDev): guard performMaintenance with IS_DRY_RUN - PR #26 (onthebigtree): hash hostname in env fingerprint, portable validation paths - PR #63 (voidborne-d): add 61 unit tests for core GEP modules - PR #21 (LKCY33): add dotenv path rewrite for public build - PR #25 (onthebigtree): already applied (currentSleepMs, matchPatternToSignals, max_files) - Update public.manifest.json: include test/*.test.js, add index.js dotenv rewrite Co-authored-by: Cursor <cursoragent@cursor.com>


Summary
Three fixes targeting privacy, portability, and dead code:
1. Hash hostname before storing in env fingerprint (
envFingerprint.js)os.hostname()was stored verbatim in every Capsule and EvolutionEvent that gets published to the public Hub.sanitize.jsdoes not cover hostnames (its redact patterns target tokens,/Users/paths, and emails — not arbitrary hostnames), so strings likejohn-macbook-pro.localleaked into the public feed.Fix: Replace the raw hostname with a 12-character SHA-256 prefix. The value still uniquely identifies an environment class for GDI measurement, without leaking machine identity.
envFingerprintKeyandisSameEnvClasscontinue to work correctly — verified.2. Remove absolute paths from
buildValidationCmd(assetStore.js)The previous implementation called
path.resolve(__dirname, '..', '..')to build absolute paths like/Users/xxx/codespace/evolver/src/evolve, which were embedded into Genevalidationcommands stored ingenes.json.Two problems:
sanitize.jsredacts/Users/...in published Capsules, corrupting the stored validation command for anyone who downloads a Gene bundle from the Hub.runValidations()already executes withcwd: repoRoot(seesolidify.js:567), sorequire('./src/evolve')style relative paths resolve correctly.Tested: the generated commands run successfully from the repo root.
3. Remove
appendCapsuledead code (assetStore.js,solidify.js)appendCapsulewas exported fromassetStore.jsand imported bysolidify.jsbut never called —solidifyexclusively usesupsertCapsule. The function also lacked deduplication logic, so any accidental call would growcapsules.jsonunboundedly with duplicate entries.Removed the function, its export, and the unused import in
solidify.js.Test plan
env_fingerprint.hostnameis a 12-char hex string, not the raw machine nameisSameEnvClassreturnstruefor two fingerprints taken on the same machinegenes.jsondefault genes —validationcommands should userequire('./src/...')relative pathsnode -e "require('./src/evolve'); require('./src/gep/solidify'); console.log('ok')"— should printok🤖 Generated with Claude Code
Note
Low Risk
Small, localized changes to fingerprint serialization and command string generation plus dead-code removal; minimal behavioral impact beyond privacy and portability.
Overview
Improves privacy and portability of published GEP assets by hashing
env_fingerprint.hostname(12-char SHA-256 prefix) and generating Genevalidationcommands as repo-root-relativerequire('./src/...')paths instead of embedding absolute machine paths.Removes dead capsule-writing API by deleting
appendCapsulefromassetStore.jsand dropping its unused import fromsolidify.js, standardizing capsule persistence onupsertCapsule.Written by Cursor Bugbot for commit 85f2b46. This will update automatically on new commits. Configure here.