Skip to content

[architecture] Make DevTools the profile-based bootstrap and upgrade orchestrator for domain packages #384

Open

Description

@coisa

Objective and current decision

Make DevTools the thin, profile-based bootstrap, composition and upgrade orchestrator for independently versioned domain tools. Bootstrap a clean project and upgrade an existing customized project without copying another repository or maintaining a universal static template. Domains own their engines, public APIs, released CLI/PHAR, workflow/Action payloads, portable skills and docs. DevTools selects, verifies and delegates; it does not reimplement domain behavior. Versioned, verified PHAR replaces CPX as the delivery direction. A Composer-global adapter is optional only if it adds demonstrated value without mandatory plugin hooks or implicit writes. Decision record.

Composition contract and verifiable acceptance

  • Select library/application/docs-only/custom profiles with explicit capabilities and opt-outs. Suggest, then preview exact choices. Record package, exact version, provenance, capability/overrides, source path/commit, previous rendered hash, target and local edits per managed artifact or region. Assign one owner per skill/workflow and retain provenance through LLM Skills ([architecture] Map domain-owned skills and replace redundant agent distribution #195), not a second skill installer. Inventory template repositories separately; no deletion implied.
  • Separate setup from execution. Explicit setup validates exact PHAR version, approved source, trusted digest and PHP/extensions compatibility before switching to the staged executable. The selected binary runs without network, downloading, latest or CPX fallback. The previous working selection survives failure, interruption or concurrent upgrade; prove rollback. Executable rollback does not revert changes to the checkout.
  • Follow Define release-safe refs for consumer workflow wrappers and checked-out actions #238 for immutable workflow/Action references. The plan records the called workflow SHA, every additional Actions checkout SHA, exact executable version/source/digest and skill source. Same-repository workflow/Actions use the same SHA by default; separately versioned combinations must be declared and qualified. Reject unavailable or incompatible refs before changing active consumer files. [architecture] Evaluate Phive as an optional channel for existing versioned PHARs #197 evaluates Phive only as an optional channel for the same qualified bytes.
  • Provide deterministic dry-run/diff/check and explicit apply. In a customized consumer fixture, preview causes no writes, publication or hook execution; replay is a no-op; intervening local edits or unavailable refs fail closed without overwriting the files. Preserve unknown content, settings, hooks, exits, JSON, cwd/cache/color options and required-check identities. Stage and validate changes before switching; verify fresh bootstrap, legacy plugin/CPX migration fixtures, missing/incompatible capabilities and failed/interrupted/concurrent updates.
  • Delegate via domain exit/result contracts with acyclic dependencies. Keep reusable logic separate from CLI I/O and writes; do not assume a PHAR isolates public PHP APIs loaded in a consumer process. Verify runtime and resources outside the source checkout; distinguish tool runtime requirements from the consumer application minimum. Update README, configuration/command docs, skill references and synchronized examples to match actual ownership. Use Add a doctor command for repository readiness diagnostics #142 for readiness diagnostics.

Git hooks: acceptance for #376 migration

  • Both installed pre-commit and commit-msg prefer project-local GrumPHP; otherwise use only a compatible executable already selected by explicit setup. Never download or invoke CPX from a hook. An absent executor fails with actionable diagnostics, not silent success. Preserve stdin, hook arguments and the actual exit code.
  • Explicitly migrate only legacy hooks whose DevTools ownership can be proved. Never silently overwrite custom, unknown or locally modified hooks. If Git uses custom core.hooksPath, preserve that configuration and its contents; do not write there as part of this increment. List each preserved or non-migrated effective hook in preview and after apply, with the reason; --no-overwrite must not treat retention as migration. --target only changes where files are written; writing in .git/hooks does not activate hooks in a custom path. Full hook-domain extraction stays in Externalize git hook logic into a dedicated git-hooks package #336.
  • In clean-install and legacy-upgrade fixtures with CPX and network unavailable, invoke both actual installed hooks through Git. Include local-executor preference, selected-executor fallback, no-executor failure and preserved custom hooks. For custom core.hooksPath, use distinct markers in the effective and default paths and compare Git invocations before and after; verify neither the setting nor custom contents changed. Inject failure installing the second managed hook: verify the previous PHAR selection and both previous hook files, including executable permissions. Demonstrate two separate rejection cases through Git: pre-commit rejects, then pre-commit succeeds and commit-msg rejects. HEAD stays unchanged in each case. Binary rollback alone is not evidence of hook rollback. Roll back managed changes from this operation, not unrelated consumer edits.
  • Baseline inspected, not executed: pre-commit, commit-msg, installer, Git hook semantics.

Dependencies, exclusions and next implementable step

Historical baseline and alternatives

SyncCommand at the October baseline coupled orchestration with metadata, hooks, Wiki and skills. #143 and #141 are historical, not proof of the composition contract. #376 originally proposed CPX and portable skills; preserve that history and migration fixtures, not CPX as the target. A shared static template drifts, copied workflows lose provenance, and a monolithic automation repo reverses domain ownership. One thin orchestrator with explicit profiles serves fresh and existing repositories without those trade-offs.

Activity

  1. added
    enhancement
    on Oct 21, 2026
  2. coisa commented on Dec 3, 2026

    @coisa
    ContributorAuthor

    Current composition contract: verified PHAR, thin DevTools

    This decision supersedes the CPX execution direction above, not the historical evidence. Update the existing #376; #403 stays an unchanged source of useful regressions, not a parallel implementation. Reserve and recheck branch ownership before any write. #240 tracks scope and sequence, #238 owns reference policy, #197 evaluates only optional Phive distribution.

    DevTools owns profiles and explicit setup, preview/apply, upgrade and rollback; domain packages own engines, workflow/Action payloads and skills. Setup resolves the exact PHAR version, source and trusted digest before activation. Running a selected binary is offline-capable: no download, latest or CPX fallback. Failure or interruption leaves the previous selection usable. Executable rollback does not revert workflow/config edits. The composition plan records workflow commit, any additional Actions checkout commit, binary version/source/digest and skill source. Adopt #238 rather than redefining its policy.

    Acceptance in #376: fixture with local customizations, valid and invalid artifact/ref inputs, offline execution, interrupted upgrade and rollback. Preview writes nothing; rerunning an applied plan is a no-op; an intervening local edit or unavailable ref must stop active application without overwriting files. Supplied local fixtures can demonstrate the contract without waiting for Testing or Documentation. Consumer activation is a separate adoption PR and requires published, qualified versions. No current coding, claim, push, release or merge authorization follows from this record.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions