Skip to content

feat(shell): auto-provision docker-git scripts inside generated containers#177

Merged
skulidropek merged 3 commits intoProverCoderAI:mainfrom
konard:issue-176-f004daa766ec
Mar 23, 2026
Merged

feat(shell): auto-provision docker-git scripts inside generated containers#177
skulidropek merged 3 commits intoProverCoderAI:mainfrom
konard:issue-176-f004daa766ec

Conversation

@konard
Copy link
Contributor

@konard konard commented Mar 22, 2026

Summary

Fixes #176

Automatically embeds docker-git scripts (session-backup, pre-commit/pre-push guards, knowledge splitter) inside generated Docker containers so that:

  • Git hooks referencing scripts/session-backup-gist.js work correctly inside containers
  • The setup-pre-commit-hook.js, pre-commit-secret-guard.sh, pre-push-knowledge-guard.js, and split-knowledge-large-files.js are available for repos cloned inside containers
  • Docker-git modules can be used inside the container without manual script copying

Changes

  • packages/lib/src/core/templates/dockerfile.ts: Added COPY scripts/ /opt/docker-git/scripts/ layer to embed scripts in Docker image
  • packages/lib/src/core/templates-entrypoint/tasks.ts: After successful clone, symlink /opt/docker-git/scripts$TARGET_DIR/scripts so relative paths in hooks resolve
  • packages/lib/src/core/templates-entrypoint/git.ts: Pre-push hook resolves session-backup-gist.js from embedded /opt/docker-git/scripts/ first, with fallback to repo-local scripts/
  • packages/lib/src/shell/files.ts: Added provisionDockerGitScripts() — copies scripts from workspace into project build context on create/update
  • packages/lib/src/core/docker-git-scripts.ts: New module defining dockerGitScriptNames — inventory of scripts to embed
  • packages/lib/src/core/templates.ts: Added scripts/ to .gitignore template (provisioned scripts are derived, not source)

Математические гарантии

Инварианты:

  • ∀ script ∈ dockerGitScriptNames: accessible(/opt/docker-git/scripts/{script})
  • ∀ repo ∈ cloned_repos: ¬∃(repo/scripts) → symlink(repo/scripts, /opt/docker-git/scripts)
  • ∀ hook ∈ git_hooks: referenced_script(hook) → resolvable(hook)

Предусловия:

  • ∃ scripts/ directory in docker-git workspace
  • docker build context contains scripts/ (provisioned by writeProjectFiles)

Постусловия:

  • ∀ container: /opt/docker-git/scripts/ exists ∧ contains all listed scripts
  • ∀ cloned_repo: scripts/ symlink → hooks function correctly

Сложность:

  • Build-time: O(|dockerGitScriptNames|) — one COPY per script
  • Runtime: O(1) — single symlink operation after clone

Verification

  • pnpm -C packages/lib typecheck passes
  • pnpm -C packages/lib build passes
  • pnpm -C packages/lib test passes
  • pnpm -C packages/lib lint:effect passes
  • pnpm -C packages/app typecheck passes

Test plan

  • Create a new docker-git project and verify scripts/ directory appears in project build context
  • Build the Docker image and verify /opt/docker-git/scripts/ exists with all scripts
  • Clone a repo inside the container and verify scripts/ symlink is created
  • Trigger a git push and verify session-backup-gist.js is found and executed

🤖 Generated with Claude Code

konard and others added 2 commits March 22, 2026 21:04
Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: ProverCoderAI#176
…iners

Embeds docker-git scripts (session-backup, pre-commit/pre-push guards,
knowledge splitter) into generated Docker images at /opt/docker-git/scripts/
so git hooks and docker-git modules work inside containers.

Changes:
- Dockerfile template: COPY scripts/ into /opt/docker-git/scripts/
- Entrypoint: symlink scripts into workspace after clone
- Pre-push hook: resolve backup script from embedded or repo-local path
- Shell: copy workspace scripts into project build context on create/update
- Core: define dockerGitScriptNames constant for script inventory
- Gitignore: exclude provisioned scripts/ from project state tracking

Fixes ProverCoderAI#176

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@konard konard changed the title [WIP] Надо сделать что бы он сам скрипты прокидывал. Ну типо использовал docker-git модули внутри контейнера feat(shell): auto-provision docker-git scripts inside generated containers Mar 22, 2026
@konard konard marked this pull request as ready for review March 22, 2026 21:17
@konard
Copy link
Contributor Author

konard commented Mar 22, 2026

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Public pricing estimate: $7.971484
  • Calculated by Anthropic: $4.881631 USD
  • Difference: $-3.089853 (-38.76%)

🤖 Models used:

  • Tool: Claude
  • Requested: opus
  • Main model: Claude Opus 4.6 (claude-opus-4-6)
  • Additional models:
    • Claude Haiku 4.5 (claude-haiku-4-5-20251001)

📎 Log file uploaded as Gist (2294KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
Copy link
Contributor Author

konard commented Mar 22, 2026

✅ Ready to merge

This pull request is now ready to be merged:

  • All CI checks have passed
  • No merge conflicts
  • No pending changes

Monitored by hive-mind with --auto-restart-until-mergeable flag

@skulidropek skulidropek merged commit e9b33cf into ProverCoderAI:main Mar 23, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants