fix(cli): repair legacy core ledgers and make --keep-local durable

Store canonical core hashes in lock.core, add core.schema and repair legacy ledgers from the registered commit before deciding drift. Skipped --keep-local files remain tracked with the target canonical hash, fail closed when the old core cannot be resolved, and update core reports per-file actions.
This commit is contained in:
kj
2026-11-21 20:41:41 -03:00
parent 9e020f0ea6
commit 66544caea6
10 changed files with 471 additions and 35 deletions
+1
View File
@@ -143,6 +143,7 @@ Harness::it('adopt del core registra hash canónico y marca ediciones locales',
eq('sha256:' . hash('sha256', $canonicalRouter), $coreHashRouter, 'hash de Router.php = canónico');
eq('sha256:' . hash('sha256', $canonicalConfig), $coreHashConfig, 'hash de config.php = canónico (aunque el local difiera)');
eq('local', $lock->core()['origin'] ?? null, 'origin = local porque hay ediciones locales');
eq(2, $lock->coreSchema(), 'adopt graba el esquema canónico');
ok(file_get_contents($proj . '/config.php') !== $canonicalConfig, 'la copia local customizada no se tocó');