Skip to content

fix(build): restore ConfigDumpInfo after failed Designer builds - #107

Closed
korolevpavel wants to merge 2 commits into
IngvarConsulting:masterfrom
korolevpavel:fix/issue-24-cdfi-recovery-v09
Closed

korolevpavel wants to merge 2 commits into
IngvarConsulting:masterfrom
korolevpavel:fix/issue-24-cdfi-recovery-v09

Conversation

@korolevpavel

Copy link
Copy Markdown

Designer /LoadConfigFromFiles -updateConfigDumpInfo can rewrite ConfigDumpInfo.xml before a build fails or stops before UpdateDBCfg. This change captures its original bytes, permissions, or absence before loading and restores that state when the step fails before a successful database update.

Closes #24. Successful-build reconciliation remains in #46.

  • Protect both project Designer sources and the generated Designer stage of EDT builds. Earlier successful source sets remain committed.
  • End rollback eligibility immediately after successful UpdateDBCfg, before persisting hashes; a later hash-storage error cannot restore an obsolete version file.
  • Return steps[].cdfi_recovery through existing CLI/MCP build results. Failed restoration retains a usable snapshot and the original error classification; cleanup failures remain warnings.
  • Create Unix snapshot directories with mode 0700 and copies/absence markers with 0600 before writing, including under permissive umasks. Reject symlinks and nonregular CDFI files without deleting them.
  • Document the recovery boundary and regression guards. This restores the version file, not database changes; automatic recovery after the runner itself crashes is outside scope.

Validation:

  • Full suite after the recovery implementation: 1150 passed, none failed or ignored.
  • After the permissions fix: 30 targeted tests passed (CLI recovery 7, CDFI unit tests 16, architecture guardrails 4, output contracts 3). The new subprocess regression first reproduced the defect, then passed for umask 022/000 with private/public original files and absent baselines.
  • Coverage includes byte-exact BOM/CRLF restoration, partial load, EDT, cancellation/deadline, failed restoration, per-source isolation, post-update hash failure, preview, and MCP receipts.
  • Formatting and diff checks passed. Independent reviewer and Rust expert passes applied rust-expert-best-practices-code-review; the discovered snapshot-permissions finding was fixed and re-reviewed. The unavailable codebase-design skill was replaced by the repository's explicit architecture checklist.
  • No live 1C or Windows execution was performed for this change. Existing unused-variable warnings remain.

The publication branch contains only these two commits on current upstream master; the rebase preserved the tested source tree exactly.

- preserve exact version-file bytes or absence until UpdateDBCfg succeeds
- retain per-step recovery receipts and usable backups on rollback failure
- cover cancellation, timeout, partial load, EDT, CLI and MCP behavior
- document recovery boundaries and add regression guards for issue IngvarConsulting#24
- restrict Unix snapshot directories and files at creation before writing
- cover retained copies and absence markers under permissive umasks
- document the permission invariant and guard against reintroduction
@zeegin

zeegin commented Sep 20, 2026 •

Copy link
Copy Markdown
Member

Закрываю, но задача остаётся — решение принято другое, и оно требует работы в другом месте.

Решение владельца: ConfigDumpInfo.xml — локальное состояние конкретной информационной базы. Он уникален для каждой базы, нужен платформе для инкрементальной выгрузки и загрузки, и в git уезжать не должен. Это ровно тот ответ, который прозвучал вопросом на закрытом #47: «А точно надо восстановление? Может его вообще в игнор?».

Из этого следует, что восстанавливать файл после неудачной сборки незачем: его там не должно быть под контролем версий вовсе. Публиковать ради этого steps[].cdfi_recovery в CTR.WIRE.BUILD-DATA — значит закрепить в опубликованном контракте признак проблемы, которой у пользователя быть не должно.

Чего это не отменяет. Раз файла законно нет в свежем клоне, открытый #97 становится настоящей ошибкой: инкрементальная выгрузка при отсутствии файла версии падает с кодом 1 и без отката на полную. Это и есть работа, которую надо сделать вместо восстановления, — плюс запись правила в документацию и добавление файла в .gitignore, который порождает config init.

Что здесь было сделано хорошо и что стоит перенести, если возьмётесь за #97: отказ на симлинки и не-обычные файлы при работе со снимком, и права 0700/0600. Эти проверки полезны сами по себе.

Спасибо за подробный разбор — именно он позволил увидеть, что вопрос не в восстановлении, а в том, чей это файл.

@zeegin zeegin closed this Sep 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(build): transactional snapshot/rollback ConfigDumpInfo.xml on failed build

2 participants