Skip to content

feat(apply-all): add --active flag to apply only to running containers#186

Merged
skulidropek merged 4 commits intoProverCoderAI:mainfrom
konard:issue-185-3519d9afb285
Mar 23, 2026
Merged

feat(apply-all): add --active flag to apply only to running containers#186
skulidropek merged 4 commits intoProverCoderAI:mainfrom
konard:issue-185-3519d9afb285

Conversation

@konard
Copy link
Contributor

@konard konard commented Mar 23, 2026

Summary

Fixes #185

Adds --active flag to docker-git apply-all (and its alias update-all) so it applies only to currently running containers, skipping stopped ones.

Changes

  • ApplyAllCommand (domain.ts): Added activeOnly: boolean field
  • Parser (parser.ts): apply-all/update-all now parse --active flag into activeOnly=true
  • applyAllDockerGitProjects (projects-apply-all.ts): Accepts ApplyAllCommand; when activeOnly=true runs docker ps and skips containers not in the running names list
  • program.ts: Passes the parsed command to applyAllDockerGitProjects
  • usage.ts: Documents --active option and updates apply-all command description
  • Tests (parser-apply-all.test.ts): Parser tests for --active flag

Usage

# Apply to all known projects (existing behavior)
docker-git apply-all

# Apply only to currently running containers
docker-git apply-all --active
docker-git update-all --active

Mathematical Guarantees

Invariants:

  • ∀p ∈ Projects: activeOnly=false → applyAll(p) (unchanged behavior without flag)
  • ∀p ∈ Projects: activeOnly=true → applyAll(p) iff running(container(p))

Postconditions:

  • activeOnly=true → ∀p skipped: ¬running(container(p))
  • Individual failures do not abort the batch (unchanged)

Complexity:

  • O(n) where n = |projects|; with --active adds one docker ps call: O(n + docker_ps)

🤖 Generated with Claude Code

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

Issue: ProverCoderAI#185
…ontainers

- Adds activeOnly field to ApplyAllCommand domain type
- Extends parser to parse --active flag for apply-all/update-all commands
- Modifies applyAllDockerGitProjects to accept command and filter by running
  containers when activeOnly=true (runs docker ps, skips stopped containers)
- Updates usage help text to document --active option
- Adds parser tests for --active flag in new parser-apply-all.test.ts
- Exports ProjectIndex type from projects-core.ts

∀p ∈ Projects: activeOnly=true → applyAll(p) iff running(container(p))

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@konard konard changed the title [WIP] Сделать что бы команда docker-git apply-all работала бы только на активные контейнеры. Точнее что бы можно было через атрибут --active применять только на активные контейнеры, а не на все feat(apply-all): add --active flag to apply only to running containers Mar 23, 2026
@konard konard marked this pull request as ready for review March 23, 2026 22:54
konard and others added 2 commits March 23, 2026 23:02
- Replace 'as Command' cast in parseApplyAll with typed variable declaration
- Rewrite parser-apply-all.test.ts to avoid 'as const' casts (no-restricted-syntax)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@konard
Copy link
Contributor Author

konard commented Mar 23, 2026

🤖 Solution Draft Log

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

💰 Cost estimation:

  • Public pricing estimate: $4.140263
  • Calculated by Anthropic: $2.810738 USD
  • Difference: $-1.329525 (-32.11%)

🤖 Models used:

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

📎 Log file uploaded as Gist (1954KB)


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 23, 2026

🔄 Auto-restart 1/3

Detected uncommitted changes from previous run. Starting new session to review and commit or discard them.

Uncommitted files:

?? ci-logs/

Auto-restart will stop after changes are committed or discarded, or after 2 more iterations. Please wait until working session will end and give your feedback.

@konard
Copy link
Contributor Author

konard commented Mar 23, 2026

🔄 Auto-restart 1/3 Log

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

💰 Cost estimation:

  • Public pricing estimate: $0.150574
  • Calculated by Anthropic: $0.180559 USD
  • Difference: $0.029985 (+19.91%)

🤖 Models used:

  • Tool: Claude
  • Requested: sonnet
  • Model: Claude Sonnet 4.6 (claude-sonnet-4-6)

📎 Log file uploaded as Gist (2114KB)


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 23, 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 b0bb650 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