cloving 0.3.19 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{LICENSE.md → LICENSE} +1 -1
- package/README.md +475 -182
- package/dist/src/authority/budgets.d.ts +12 -0
- package/dist/src/authority/budgets.js +42 -0
- package/dist/src/authority/commands.d.ts +7 -0
- package/dist/src/authority/commands.js +263 -0
- package/dist/src/authority/details.d.ts +28 -0
- package/dist/src/authority/details.js +33 -0
- package/dist/src/authority/dispatch-decision.d.ts +40 -0
- package/dist/src/authority/dispatch-decision.js +47 -0
- package/dist/src/authority/effect-requests.d.ts +2 -0
- package/dist/src/authority/effect-requests.js +139 -0
- package/dist/src/authority/effect-results.d.ts +4 -0
- package/dist/src/authority/effect-results.js +236 -0
- package/dist/src/authority/events.d.ts +2 -0
- package/dist/src/authority/events.js +45 -0
- package/dist/src/authority/gate-reduction.d.ts +8 -0
- package/dist/src/authority/gate-reduction.js +109 -0
- package/dist/src/authority/gates.d.ts +48 -0
- package/dist/src/authority/gates.js +77 -0
- package/dist/src/authority/history-state.d.ts +15 -0
- package/dist/src/authority/history-state.js +61 -0
- package/dist/src/authority/history.d.ts +13 -0
- package/dist/src/authority/history.js +37 -0
- package/dist/src/authority/instants.d.ts +3 -0
- package/dist/src/authority/instants.js +38 -0
- package/dist/src/authority/leases.d.ts +15 -0
- package/dist/src/authority/leases.js +113 -0
- package/dist/src/authority/operations.d.ts +101 -0
- package/dist/src/authority/operations.js +75 -0
- package/dist/src/authority/reconciliation.d.ts +27 -0
- package/dist/src/authority/reconciliation.js +147 -0
- package/dist/src/authority/reducer.d.ts +41 -0
- package/dist/src/authority/reducer.js +139 -0
- package/dist/src/authority/reduction-state.d.ts +36 -0
- package/dist/src/authority/reduction-state.js +68 -0
- package/dist/src/authority/reduction.d.ts +6 -0
- package/dist/src/authority/reduction.js +160 -0
- package/dist/src/authority/status-closure.d.ts +4 -0
- package/dist/src/authority/status-closure.js +57 -0
- package/dist/src/authority/status-effects.d.ts +17 -0
- package/dist/src/authority/status-effects.js +43 -0
- package/dist/src/authority/status-input.d.ts +45 -0
- package/dist/src/authority/status-input.js +9 -0
- package/dist/src/authority/status.d.ts +32 -0
- package/dist/src/authority/status.js +256 -0
- package/dist/src/authority/stop-sequence.d.ts +37 -0
- package/dist/src/authority/stop-sequence.js +91 -0
- package/dist/src/authority/transitions.d.ts +63 -0
- package/dist/src/authority/transitions.js +122 -0
- package/dist/src/broker/actor/adapter-calls.d.ts +13 -0
- package/dist/src/broker/actor/adapter-calls.js +34 -0
- package/dist/src/broker/actor/adapter-outcomes.d.ts +28 -0
- package/dist/src/broker/actor/adapter-outcomes.js +80 -0
- package/dist/src/broker/actor/authority-actor.d.ts +25 -0
- package/dist/src/broker/actor/authority-actor.js +169 -0
- package/dist/src/broker/actor/authority-changes.d.ts +31 -0
- package/dist/src/broker/actor/authority-changes.js +46 -0
- package/dist/src/broker/actor/authority-connection.d.ts +15 -0
- package/dist/src/broker/actor/authority-connection.js +44 -0
- package/dist/src/broker/actor/authority-conversion.d.ts +10 -0
- package/dist/src/broker/actor/authority-conversion.js +72 -0
- package/dist/src/broker/actor/authority-delivery.d.ts +13 -0
- package/dist/src/broker/actor/authority-delivery.js +162 -0
- package/dist/src/broker/actor/authority-logger.d.ts +2 -0
- package/dist/src/broker/actor/authority-logger.js +19 -0
- package/dist/src/broker/actor/authority-policy.d.ts +9 -0
- package/dist/src/broker/actor/authority-policy.js +11 -0
- package/dist/src/broker/actor/authority-queries.d.ts +45 -0
- package/dist/src/broker/actor/authority-queries.js +85 -0
- package/dist/src/broker/actor/authority-receipts.d.ts +28 -0
- package/dist/src/broker/actor/authority-receipts.js +84 -0
- package/dist/src/broker/actor/authority-release.d.ts +13 -0
- package/dist/src/broker/actor/authority-release.js +69 -0
- package/dist/src/broker/actor/authority-runtime.d.ts +60 -0
- package/dist/src/broker/actor/authority-runtime.js +204 -0
- package/dist/src/broker/actor/authority-session.d.ts +65 -0
- package/dist/src/broker/actor/authority-session.js +252 -0
- package/dist/src/broker/actor/authority-settings.d.ts +33 -0
- package/dist/src/broker/actor/authority-settings.js +63 -0
- package/dist/src/broker/actor/authority-upgrades.d.ts +16 -0
- package/dist/src/broker/actor/authority-upgrades.js +12 -0
- package/dist/src/broker/actor/authority-watchdog.d.ts +14 -0
- package/dist/src/broker/actor/authority-watchdog.js +41 -0
- package/dist/src/broker/actor/authority.d.ts +14 -0
- package/dist/src/broker/actor/authority.js +115 -0
- package/dist/src/broker/actor/delivery-intents.d.ts +68 -0
- package/dist/src/broker/actor/delivery-intents.js +77 -0
- package/dist/src/broker/actor/delivery-plan.d.ts +2 -0
- package/dist/src/broker/actor/delivery-plan.js +109 -0
- package/dist/src/broker/actor/delivery-results.d.ts +11 -0
- package/dist/src/broker/actor/delivery-results.js +63 -0
- package/dist/src/broker/actor/effect-delivery.d.ts +19 -0
- package/dist/src/broker/actor/effect-delivery.js +118 -0
- package/dist/src/broker/actor/effect-plan.d.ts +41 -0
- package/dist/src/broker/actor/effect-plan.js +173 -0
- package/dist/src/broker/actor/effect-queries.d.ts +27 -0
- package/dist/src/broker/actor/effect-queries.js +80 -0
- package/dist/src/broker/actor/effect-turn.d.ts +25 -0
- package/dist/src/broker/actor/effect-turn.js +84 -0
- package/dist/src/broker/actor/pin-check.d.ts +6 -0
- package/dist/src/broker/actor/pin-check.js +12 -0
- package/dist/src/broker/actor/runtime-parts.d.ts +23 -0
- package/dist/src/broker/actor/runtime-parts.js +34 -0
- package/dist/src/broker/actor/stop-plan.d.ts +20 -0
- package/dist/src/broker/actor/stop-plan.js +46 -0
- package/dist/src/broker/actor/stop-turn.d.ts +17 -0
- package/dist/src/broker/actor/stop-turn.js +42 -0
- package/dist/src/broker/actor/turn-draft.d.ts +31 -0
- package/dist/src/broker/actor/turn-draft.js +138 -0
- package/dist/src/broker/actor/turn-plan.d.ts +17 -0
- package/dist/src/broker/actor/turn-plan.js +136 -0
- package/dist/src/broker/actor/turn-refusals.d.ts +8 -0
- package/dist/src/broker/actor/turn-refusals.js +35 -0
- package/dist/src/broker/actor/turn-staging.d.ts +78 -0
- package/dist/src/broker/actor/turn-staging.js +34 -0
- package/dist/src/broker/actor/turn-state.d.ts +34 -0
- package/dist/src/broker/actor/turn-state.js +208 -0
- package/dist/src/broker/authority-admission.d.ts +21 -0
- package/dist/src/broker/authority-admission.js +70 -0
- package/dist/src/broker/authority-restore.d.ts +30 -0
- package/dist/src/broker/authority-restore.js +165 -0
- package/dist/src/broker/decision-restore.d.ts +16 -0
- package/dist/src/broker/decision-restore.js +158 -0
- package/dist/src/broker/decision-upgrade.d.ts +3 -0
- package/dist/src/broker/decision-upgrade.js +12 -0
- package/dist/src/broker/effect-restore.d.ts +20 -0
- package/dist/src/broker/effect-restore.js +111 -0
- package/dist/src/broker/effect-upgrade.d.ts +3 -0
- package/dist/src/broker/effect-upgrade.js +9 -0
- package/dist/src/broker/operation-digest.d.ts +1 -0
- package/dist/src/broker/operation-digest.js +4 -0
- package/dist/src/broker/socket-address.d.ts +9 -0
- package/dist/src/broker/socket-address.js +14 -0
- package/dist/src/broker/workflow-pin.d.ts +2 -0
- package/dist/src/broker/workflow-pin.js +5 -0
- package/dist/src/chats/destination.d.ts +4 -0
- package/dist/src/chats/destination.js +94 -0
- package/dist/src/chats/import.d.ts +13 -0
- package/dist/src/chats/import.js +71 -0
- package/dist/src/chats/normalize.d.ts +20 -0
- package/dist/src/chats/normalize.js +139 -0
- package/dist/src/chats/reader.d.ts +15 -0
- package/dist/src/chats/reader.js +87 -0
- package/dist/src/cli/arguments.d.ts +23 -0
- package/dist/src/cli/arguments.js +154 -0
- package/dist/src/cli/client.d.ts +15 -0
- package/dist/src/cli/client.js +122 -0
- package/dist/src/cli/commands.d.ts +14 -0
- package/dist/src/cli/commands.js +253 -0
- package/dist/src/cli/main.d.ts +1 -0
- package/dist/src/cli/main.js +80 -0
- package/dist/src/cli/render.d.ts +8 -0
- package/dist/src/cli/render.js +186 -0
- package/dist/src/cli/runtime-arguments.d.ts +73 -0
- package/dist/src/cli/runtime-arguments.js +248 -0
- package/dist/src/cli/runtime-directory.d.ts +4 -0
- package/dist/src/cli/runtime-directory.js +25 -0
- package/dist/src/cli/toolchain.d.ts +3 -0
- package/dist/src/cli/toolchain.js +74 -0
- package/dist/src/cli/usage.d.ts +4 -0
- package/dist/src/cli/usage.js +124 -0
- package/dist/src/cli/validate.d.ts +38 -0
- package/dist/src/cli/validate.js +116 -0
- package/dist/src/cli/watch-board-view.d.ts +22 -0
- package/dist/src/cli/watch-board-view.js +128 -0
- package/dist/src/cli/watch-board.d.ts +15 -0
- package/dist/src/cli/watch-board.js +174 -0
- package/dist/src/cli/watch-element.d.ts +11 -0
- package/dist/src/cli/watch-element.js +6 -0
- package/dist/src/cli/watch-model.d.ts +29 -0
- package/dist/src/cli/watch-model.js +261 -0
- package/dist/src/cli/watch-navigation.d.ts +9 -0
- package/dist/src/cli/watch-navigation.js +40 -0
- package/dist/src/cli/watch-page.d.ts +1 -0
- package/dist/src/cli/watch-page.js +272 -0
- package/dist/src/cli/watch-paths.d.ts +2 -0
- package/dist/src/cli/watch-paths.js +52 -0
- package/dist/src/cli/watch-phases.d.ts +7 -0
- package/dist/src/cli/watch-phases.js +148 -0
- package/dist/src/cli/watch-reads.d.ts +28 -0
- package/dist/src/cli/watch-reads.js +244 -0
- package/dist/src/cli/watch-render.d.ts +139 -0
- package/dist/src/cli/watch-render.js +95 -0
- package/dist/src/cli/watch-server.d.ts +10 -0
- package/dist/src/cli/watch-server.js +176 -0
- package/dist/src/cli/watch-stream.d.ts +11 -0
- package/dist/src/cli/watch-stream.js +128 -0
- package/dist/src/cli/watch-turn.d.ts +29 -0
- package/dist/src/cli/watch-turn.js +130 -0
- package/dist/src/cli/watch-view.d.ts +39 -0
- package/dist/src/cli/watch-view.js +223 -0
- package/dist/src/cli.d.ts +2 -0
- package/dist/src/cli.js +62 -0
- package/dist/src/daemon/claude-turn.d.ts +28 -0
- package/dist/src/daemon/claude-turn.js +135 -0
- package/dist/src/daemon/claude-worker.d.ts +26 -0
- package/dist/src/daemon/claude-worker.js +224 -0
- package/dist/src/daemon/codex-stream.d.ts +4 -0
- package/dist/src/daemon/codex-stream.js +113 -0
- package/dist/src/daemon/daemon.d.ts +46 -0
- package/dist/src/daemon/daemon.js +186 -0
- package/dist/src/daemon/delivery-router.d.ts +10 -0
- package/dist/src/daemon/delivery-router.js +34 -0
- package/dist/src/daemon/github-calls.d.ts +29 -0
- package/dist/src/daemon/github-calls.js +127 -0
- package/dist/src/daemon/github-issue-methods.d.ts +3 -0
- package/dist/src/daemon/github-issue-methods.js +99 -0
- package/dist/src/daemon/github-issue-privacy.d.ts +6 -0
- package/dist/src/daemon/github-issue-privacy.js +131 -0
- package/dist/src/daemon/github-merge.d.ts +18 -0
- package/dist/src/daemon/github-merge.js +259 -0
- package/dist/src/daemon/github-methods.d.ts +5 -0
- package/dist/src/daemon/github-methods.js +198 -0
- package/dist/src/daemon/github-operation.d.ts +38 -0
- package/dist/src/daemon/github-operation.js +57 -0
- package/dist/src/daemon/github-worker.d.ts +17 -0
- package/dist/src/daemon/github-worker.js +281 -0
- package/dist/src/daemon/host-environment.d.ts +8 -0
- package/dist/src/daemon/host-environment.js +14 -0
- package/dist/src/daemon/issue-queue.d.ts +9 -0
- package/dist/src/daemon/issue-queue.js +163 -0
- package/dist/src/daemon/notify-message.d.ts +14 -0
- package/dist/src/daemon/notify-message.js +48 -0
- package/dist/src/daemon/notify.d.ts +12 -0
- package/dist/src/daemon/notify.js +161 -0
- package/dist/src/daemon/operation-journal.d.ts +42 -0
- package/dist/src/daemon/operation-journal.js +53 -0
- package/dist/src/daemon/ticket-registration.d.ts +33 -0
- package/dist/src/daemon/ticket-registration.js +177 -0
- package/dist/src/daemon/ticket-source.d.ts +17 -0
- package/dist/src/daemon/ticket-source.js +36 -0
- package/dist/src/daemon/work-tree.d.ts +26 -0
- package/dist/src/daemon/work-tree.js +206 -0
- package/dist/src/effect-authorization.d.ts +21 -0
- package/dist/src/effect-authorization.js +14 -0
- package/dist/src/execution-pin.d.ts +4 -0
- package/dist/src/execution-pin.js +68 -0
- package/dist/src/host/start-delivery.d.ts +41 -0
- package/dist/src/host/start-delivery.js +68 -0
- package/dist/src/host/step-bridge-host.d.ts +79 -0
- package/dist/src/host/step-bridge-host.js +205 -0
- package/dist/src/host/step-claims.d.ts +31 -0
- package/dist/src/host/step-claims.js +85 -0
- package/dist/src/host/world-host.d.ts +21 -0
- package/dist/src/host/world-host.js +51 -0
- package/dist/src/host/world-reconciliation.d.ts +37 -0
- package/dist/src/host/world-reconciliation.js +75 -0
- package/dist/src/host/world-runs.d.ts +14 -0
- package/dist/src/host/world-runs.js +61 -0
- package/dist/src/operation-identity.d.ts +7 -0
- package/dist/src/operation-identity.js +59 -0
- package/dist/src/protocol.d.ts +35 -0
- package/dist/src/protocol.js +64 -0
- package/dist/src/resource-files.d.ts +1 -0
- package/dist/src/resource-files.js +29 -0
- package/dist/src/service/changes.d.ts +11 -0
- package/dist/src/service/changes.js +32 -0
- package/dist/src/service/decision-handler.d.ts +9 -0
- package/dist/src/service/decision-handler.js +233 -0
- package/dist/src/service/event-handler.d.ts +10 -0
- package/dist/src/service/event-handler.js +70 -0
- package/dist/src/service/expiry.d.ts +13 -0
- package/dist/src/service/expiry.js +53 -0
- package/dist/src/service/gateway.d.ts +21 -0
- package/dist/src/service/gateway.js +120 -0
- package/dist/src/service/registry.d.ts +40 -0
- package/dist/src/service/registry.js +13 -0
- package/dist/src/service/replies.d.ts +26 -0
- package/dist/src/service/replies.js +56 -0
- package/dist/src/service/run-handlers.d.ts +4 -0
- package/dist/src/service/run-handlers.js +271 -0
- package/dist/src/service/service.d.ts +58 -0
- package/dist/src/service/service.js +212 -0
- package/dist/src/service/submission-handler.d.ts +4 -0
- package/dist/src/service/submission-handler.js +206 -0
- package/dist/src/service/transport.d.ts +16 -0
- package/dist/src/service/transport.js +141 -0
- package/dist/src/service/worker-port.d.ts +85 -0
- package/dist/src/service/worker-port.js +126 -0
- package/dist/src/step-bridge.d.ts +57 -0
- package/dist/src/step-bridge.js +4 -0
- package/dist/src/steps/decision-gate.d.ts +2 -0
- package/dist/src/steps/decision-gate.js +8 -0
- package/dist/src/steps/load-cycle.d.ts +10 -0
- package/dist/src/steps/load-cycle.js +11 -0
- package/dist/src/steps/protected-effect.d.ts +2 -0
- package/dist/src/steps/protected-effect.js +8 -0
- package/dist/src/storage/decision-rows.d.ts +54 -0
- package/dist/src/storage/decision-rows.js +72 -0
- package/dist/src/storage/decision-snapshots.d.ts +17 -0
- package/dist/src/storage/decision-snapshots.js +25 -0
- package/dist/src/storage/domain-changes.d.ts +48 -0
- package/dist/src/storage/domain-changes.js +213 -0
- package/dist/src/storage/domain-rows.d.ts +85 -0
- package/dist/src/storage/domain-rows.js +129 -0
- package/dist/src/storage/domain-schema.d.ts +32 -0
- package/dist/src/storage/domain-schema.js +193 -0
- package/dist/src/storage/effect-changes.d.ts +5 -0
- package/dist/src/storage/effect-changes.js +105 -0
- package/dist/src/storage/effect-rows.d.ts +67 -0
- package/dist/src/storage/effect-rows.js +74 -0
- package/dist/src/storage/effect-schema.d.ts +1 -0
- package/dist/src/storage/effect-schema.js +59 -0
- package/dist/src/storage/statements.d.ts +9 -0
- package/dist/src/storage/statements.js +8 -0
- package/dist/src/submission.d.ts +42 -0
- package/dist/src/submission.js +71 -0
- package/dist/src/turn-profile.d.ts +13 -0
- package/dist/src/turn-profile.js +100 -0
- package/dist/src/workflow-admission.d.ts +45 -0
- package/dist/src/workflow-admission.js +151 -0
- package/dist/src/workflow-contracts.d.ts +27 -0
- package/dist/src/workflow-contracts.js +88 -0
- package/dist/src/workflow-declaration.d.ts +11 -0
- package/dist/src/workflow-declaration.js +57 -0
- package/dist/src/workflow-resources.d.ts +8 -0
- package/dist/src/workflow-resources.js +14 -0
- package/dist/src/workflows.d.ts +5 -0
- package/dist/src/workflows.js +3 -0
- package/dist/tools/compile-workflows.d.ts +1 -0
- package/dist/tools/compile-workflows.js +33 -0
- package/dist/tools/self-host-processes.d.ts +10 -0
- package/dist/tools/self-host-processes.js +151 -0
- package/dist/tools/self-host-workflows.d.ts +15 -0
- package/dist/tools/self-host-workflows.js +78 -0
- package/dist/tools/self-host.d.ts +1 -0
- package/dist/tools/self-host.js +261 -0
- package/dist/tools/self-update-host.d.ts +6 -0
- package/dist/tools/self-update-host.js +41 -0
- package/dist/tools/self-update.d.ts +10 -0
- package/dist/tools/self-update.js +105 -0
- package/dist/tools/workflow-manifest.d.ts +3 -0
- package/dist/tools/workflow-manifest.js +34 -0
- package/dist/workflows/develop-prd.d.ts +7 -0
- package/dist/workflows/develop-prd.js +97 -0
- package/dist/workflows/develop-ticket.d.ts +15 -0
- package/dist/workflows/develop-ticket.js +301 -0
- package/dist/workflows/issue-labels.d.ts +14 -0
- package/dist/workflows/issue-labels.js +36 -0
- package/package.json +82 -75
- package/.DS_Store +0 -0
- package/.aider.chat.history.md +0 -16978
- package/.aider.input.history +0 -15
- package/.aider.tags.cache.v3/cache.db +0 -0
- package/.aider.tags.cache.v3/cache.db-shm +0 -0
- package/.aider.tags.cache.v3/cache.db-wal +0 -0
- package/.cursorrules +0 -77
- package/.github/workflows/auto-release.yml +0 -83
- package/.github/workflows/ci.yml +0 -32
- package/.github/workflows/npm-publish.yml +0 -34
- package/.gitignore +0 -67
- package/.husky/_/.gitignore +0 -1
- package/.husky/_/applypatch-msg +0 -2
- package/.husky/_/commit-msg +0 -2
- package/.husky/_/h +0 -22
- package/.husky/_/husky.sh +0 -9
- package/.husky/_/post-applypatch +0 -2
- package/.husky/_/post-checkout +0 -2
- package/.husky/_/post-commit +0 -2
- package/.husky/_/post-merge +0 -2
- package/.husky/_/post-rewrite +0 -2
- package/.husky/_/pre-applypatch +0 -2
- package/.husky/_/pre-auto-gc +0 -2
- package/.husky/_/pre-commit +0 -2
- package/.husky/_/pre-merge-commit +0 -2
- package/.husky/_/pre-push +0 -2
- package/.husky/_/pre-rebase +0 -2
- package/.husky/_/prepare-commit-msg +0 -2
- package/.husky/pre-commit +0 -1
- package/.husky/pre-push +0 -1
- package/.prettierrc.json +0 -7
- package/.tool-versions +0 -2
- package/SECURITY.md +0 -15
- package/cloving.json +0 -67
- package/dist/abstract_gpt/index.js +0 -55
- package/dist/cloving_gpt/adapters/Adapter.js +0 -2
- package/dist/cloving_gpt/adapters/azureopenai.js +0 -69
- package/dist/cloving_gpt/adapters/claude.js +0 -128
- package/dist/cloving_gpt/adapters/gemini.js +0 -135
- package/dist/cloving_gpt/adapters/gpt4all.js +0 -29
- package/dist/cloving_gpt/adapters/index.js +0 -2
- package/dist/cloving_gpt/adapters/mistral.js +0 -128
- package/dist/cloving_gpt/adapters/ollama.js +0 -128
- package/dist/cloving_gpt/adapters/openai.js +0 -100
- package/dist/cloving_gpt/index.js +0 -192
- package/dist/commands/analyze.js +0 -47
- package/dist/commands/chat.js +0 -14
- package/dist/commands/check.js +0 -7
- package/dist/commands/commit.js +0 -44
- package/dist/commands/config.js +0 -167
- package/dist/commands/describe.js +0 -235
- package/dist/commands/generate/code.js +0 -21
- package/dist/commands/generate/commit.js +0 -11
- package/dist/commands/generate/context.js +0 -82
- package/dist/commands/generate/docs.js +0 -11
- package/dist/commands/generate/documentation.js +0 -11
- package/dist/commands/generate/fizzbuzz.js +0 -35
- package/dist/commands/generate/init.js +0 -15
- package/dist/commands/generate/review.js +0 -11
- package/dist/commands/generate/sh.js +0 -95
- package/dist/commands/generate/shell.js +0 -11
- package/dist/commands/generate/unit_tests.js +0 -11
- package/dist/commands/init.js +0 -13
- package/dist/commands/models.js +0 -22
- package/dist/commands/project/build.js +0 -88
- package/dist/commands/project/complete.js +0 -12
- package/dist/commands/project/init.js +0 -82
- package/dist/commands/project/plan.js +0 -108
- package/dist/commands/proxy.js +0 -11
- package/dist/commands/review.js +0 -50
- package/dist/commands/tokens.js +0 -75
- package/dist/commands/unit_tests.js +0 -150
- package/dist/commands/update.js +0 -7
- package/dist/file2.js +0 -4
- package/dist/index.js +0 -134
- package/dist/managers/BlockManager.js +0 -120
- package/dist/managers/ChatManager.js +0 -653
- package/dist/managers/ChunkManager.js +0 -32
- package/dist/managers/CodeManager.js +0 -185
- package/dist/managers/CommitManager.js +0 -64
- package/dist/managers/DocsManager.js +0 -88
- package/dist/managers/DocumentationManager.js +0 -114
- package/dist/managers/InitManager.js +0 -230
- package/dist/managers/ProxyManager.js +0 -210
- package/dist/managers/ReviewManager.js +0 -131
- package/dist/managers/ShellManager.js +0 -163
- package/dist/managers/StreamManager.js +0 -308
- package/dist/managers/UnitTestManager.js +0 -243
- package/dist/managers/src/managers/ProxyManager.js +0 -1
- package/dist/newfile.js +0 -2
- package/dist/package.json +0 -86
- package/dist/utils/command_utils.js +0 -384
- package/dist/utils/config_utils.js +0 -249
- package/dist/utils/gitUtils.js +0 -42
- package/dist/utils/git_utils.js +0 -217
- package/dist/utils/modelUtils.js +0 -7
- package/dist/utils/model_utils.js +0 -7
- package/dist/utils/prompt_utils.js +0 -333
- package/dist/utils/prompts/CODEGEN_COULDNT_APPLY.md +0 -5
- package/dist/utils/prompts/CODEGEN_EXAMPLES.md +0 -82
- package/dist/utils/prompts/CODEGEN_INSTRUCTIONS.md +0 -43
- package/dist/utils/prompts/DOCS_INSTRUCTIONS.md +0 -9
- package/dist/utils/prompts/INIT_INSTRUCTIONS.md +0 -132
- package/dist/utils/prompts/REVIEW_INSTRUCTIONS.md +0 -49
- package/dist/utils/prompts/SHELL_INSTRUCTIONS.md +0 -15
- package/dist/utils/prompts/SPECIAL_FILES.md +0 -66
- package/dist/utils/prompts/index.js +0 -27
- package/dist/utils/string_utils.js +0 -505
- package/dist/utils/types.js +0 -2
- package/jest.config.js +0 -11
- package/src/cloving_gpt/adapters/azureopenai.ts +0 -83
- package/src/cloving_gpt/adapters/claude.ts +0 -140
- package/src/cloving_gpt/adapters/gemini.ts +0 -146
- package/src/cloving_gpt/adapters/index.ts +0 -43
- package/src/cloving_gpt/adapters/mistral.ts +0 -142
- package/src/cloving_gpt/adapters/ollama.ts +0 -136
- package/src/cloving_gpt/adapters/openai.ts +0 -113
- package/src/cloving_gpt/index.ts +0 -229
- package/src/commands/chat.ts +0 -12
- package/src/commands/config.ts +0 -192
- package/src/commands/generate/code.ts +0 -18
- package/src/commands/generate/commit.ts +0 -9
- package/src/commands/generate/context.ts +0 -93
- package/src/commands/generate/docs.ts +0 -9
- package/src/commands/generate/review.ts +0 -9
- package/src/commands/generate/shell.ts +0 -9
- package/src/commands/generate/unit_tests.ts +0 -9
- package/src/commands/init.ts +0 -9
- package/src/commands/models.ts +0 -21
- package/src/commands/proxy.ts +0 -9
- package/src/commands/tokens.ts +0 -82
- package/src/index.ts +0 -197
- package/src/managers/BlockManager.ts +0 -126
- package/src/managers/ChatManager.ts +0 -755
- package/src/managers/ChunkManager.ts +0 -31
- package/src/managers/CodeManager.ts +0 -226
- package/src/managers/CommitManager.ts +0 -71
- package/src/managers/DocsManager.ts +0 -101
- package/src/managers/InitManager.ts +0 -263
- package/src/managers/ProxyManager.ts +0 -240
- package/src/managers/ReviewManager.ts +0 -154
- package/src/managers/ShellManager.ts +0 -172
- package/src/managers/StreamManager.ts +0 -353
- package/src/managers/UnitTestManager.ts +0 -293
- package/src/utils/config_utils.ts +0 -271
- package/src/utils/git_utils.ts +0 -230
- package/src/utils/model_utils.ts +0 -3
- package/src/utils/prompt_utils.ts +0 -375
- package/src/utils/prompts/CODEGEN_COULDNT_APPLY.md +0 -5
- package/src/utils/prompts/CODEGEN_EXAMPLES.md +0 -82
- package/src/utils/prompts/CODEGEN_INSTRUCTIONS.md +0 -43
- package/src/utils/prompts/DOCS_INSTRUCTIONS.md +0 -9
- package/src/utils/prompts/INIT_INSTRUCTIONS.md +0 -132
- package/src/utils/prompts/REVIEW_INSTRUCTIONS.md +0 -49
- package/src/utils/prompts/SHELL_INSTRUCTIONS.md +0 -15
- package/src/utils/prompts/SPECIAL_FILES.md +0 -66
- package/src/utils/prompts/index.ts +0 -37
- package/src/utils/string_utils.ts +0 -552
- package/src/utils/types.ts +0 -127
- package/tests/commands/generate/unit_tests.test.ts +0 -27
- package/tests/utils/git_utils.test.ts +0 -116
- package/tests/utils/model_utils.test.ts +0 -27
- package/tests/utils/prompt_utils.test.ts +0 -33
- package/tests/utils/string_utils.test.ts +0 -560
- package/tsconfig.json +0 -14
- package/yarn.lock +0 -5823
package/README.md
CHANGED
|
@@ -1,264 +1,557 @@
|
|
|
1
1
|
# Cloving
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The world's easiest software factory.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Build a software factory with simple TypeScript for your project, and your project can build itself.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
The end of vibe coding. This is agentic engineering.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
A workflow file in TypeScript is the factory. It sets the steps: a worker turn in a work tree, a pull request, a review and a merge. Cloving keeps the state of each run and a record of each step. A GitHub step continues after a restart of the service. A worker turn in work stops at a restart. Cloving builds itself through `develop-issue` in this repository.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
## Cloving
|
|
12
12
|
|
|
13
|
-
Cloving
|
|
13
|
+
Cloving is a local durable development workflow service in TypeScript. You give it a ticket or the text of a task. A Claude Code worker does the work on a new git branch in its own work tree. Then you, or a review on GitHub, decide about the work. The service records each run, each event and each decision on your computer.
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
This pre-release has one supervised slice: a service for one git repository, a workflow host, a Claude Code worker, a GitHub worker and review rounds. `cloving --help` lists the commands.
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
What works now:
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
- `cloving start` starts the service for one git repository, with the workflow host, the Claude worker and a watch page.
|
|
20
|
+
- Three workflows from one workflow file: `develop-prompt`, `develop-ticket` and `develop-issue`.
|
|
21
|
+
- In a run of `develop-ticket` or `develop-prompt`, the operator approves or denies the work of each round. A run has a maximum of three rounds.
|
|
22
|
+
- In a run of `develop-issue`, Greptile reviews the pull request. The GitHub worker merges the pull request at the confidence score 5/5, with no human approval.
|
|
23
|
+
- Cloving develops itself through `develop-issue`, with a Greptile review and an automatic merge.
|
|
24
|
+
- The watch page shows the runs, the events and the work of the Claude worker as it occurs.
|
|
25
|
+
- `cloving chats import -- FILE_A FILE_B` imports selected Claude Code transcripts into private runtime files without a service.
|
|
23
26
|
|
|
24
|
-
|
|
27
|
+
What does not work yet:
|
|
25
28
|
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
29
|
+
- The Claude worker is not confined. It runs as the current user.
|
|
30
|
+
- An approval does not merge the branch. You merge the branch yourself.
|
|
31
|
+
- `cloving start` loads only the workflow file `workflows/develop-ticket.ts`. A new workflow file also needs changes of the code (see "Develop a workflow").
|
|
32
|
+
- Cloving cannot make a workflow from your earlier chats yet. The issues [#42](https://github.com/cloving-ai/cloving-ai/issues/42), [#43](https://github.com/cloving-ai/cloving-ai/issues/43) and [#44](https://github.com/cloving-ai/cloving-ai/issues/44) are open for this work. Until then, the prompt "Find workflows in your chats" is a guide for a coding agent.
|
|
33
|
+
- This pre-release package is not published to npm.
|
|
31
34
|
|
|
32
|
-
|
|
35
|
+
### Import selected chats
|
|
33
36
|
|
|
34
|
-
|
|
37
|
+
```sh
|
|
38
|
+
cloving chats import -- TRANSCRIPT_A.jsonl TRANSCRIPT_B.jsonl
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Select each file explicitly. Relative paths use the current directory. The command does not scan directories or expand globs. Your shell can expand an unquoted glob. A source must be a regular file of at most 10 MiB (10,485,760 bytes). Symbolic links are refused. Sources keep their original bytes.
|
|
42
|
+
|
|
43
|
+
The supported Claude Code JSONL subset has `user` and `assistant` envelopes with a matching `message.role`. Content can be a string or an ordered array of `text`, `tool_use` and `tool_result` blocks. Records preserve the role, timestamp, session ID, tool fields and original block positions. Missing timestamps and session IDs become `null`. Thinking blocks and non-message metadata are omitted and counted. Unknown message shapes or blocks refuse the entire source. Claude Code's internal transcript format can change between versions.
|
|
44
|
+
|
|
45
|
+
Each import creates `chats/IMPORT_ID/corpus.jsonl` and `coverage.json` below the resolved Cloving runtime directory. Selection uses a nonempty `CLOVING_RUNTIME_DIR`, then `XDG_RUNTIME_DIR/cloving`, then `XDG_STATE_HOME/cloving/run`, then `HOME/.local/state/cloving/run`. Relative settings resolve against the current directory. Destinations inside a Git repository are refused, including through symbolic links. New directories have mode `0700`; files have mode `0600`. These permissions add no encryption or redaction.
|
|
46
|
+
|
|
47
|
+
Corpus records have `schemaVersion: 1` and a `sourceId` of `sha256:HEX:OFFSET`. The digest covers the exact source bytes. The offset is the zero-based byte position of the source line. `text` joins the message's text blocks with a newline; `blocks` retains each supported block's `position`. Tool result content is copied as JSON data. The versioned coverage manifest has one entry per selection, including its resolved path, status, fixed reason code, digest when available, record count and omission counts (`metadataRecords` and `thinkingBlocks`). Refused sources contribute no records. The final manifest appears only after the corpus closes successfully.
|
|
48
|
+
|
|
49
|
+
Console output contains counts, fixed codes and an opaque import ID. Source paths and transcript text stay in the private files. Exit code `0` means every source was included. Code `1` means partial coverage or an output failure. Code `2` means invalid usage. Importing does not analyze chats, call a model or execute transcript instructions. Full quality admission and release qualification remain pending.
|
|
50
|
+
|
|
51
|
+
## Install
|
|
52
|
+
|
|
53
|
+
The current pilot uses Node 26.9.0 and npm 11.19.1 on macOS 27.0 on arm64. The installation ranges in `package.json` do not qualify other workflow runtimes: workflow admission still requires exactly Node 26.9.0. GitHub-hosted macOS 15 arm64 qualification is pending its CI quality and packed-startup checks. Other platforms and runtime versions are unqualified.
|
|
54
|
+
|
|
55
|
+
A run needs these tools:
|
|
56
|
+
|
|
57
|
+
- `git`.
|
|
58
|
+
- The `claude` command of Claude Code on the search path. The Claude worker runs it as the current user.
|
|
59
|
+
- For `develop-issue` only: the `gh` command with a login, and a GitHub repository that Greptile reviews. The worker uses the `gh` login and the git credentials of the current user.
|
|
35
60
|
|
|
36
|
-
|
|
61
|
+
Once the operator publishes this package, install the executable with:
|
|
37
62
|
|
|
38
|
-
|
|
39
|
-
-
|
|
40
|
-
|
|
63
|
+
```sh
|
|
64
|
+
npm install --global cloving --ignore-scripts
|
|
65
|
+
cloving --version
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
This package replaces the older Cloving CLI under the same npm name. The registry currently serves that older CLI; the command above is for after this release is published. The installed package includes startup, the watch command, bundled workflows and the SDK compiler integration. It starts without a source checkout or development dependencies, using the installed runtime dependencies. Installation runs no scripts and starts no service.
|
|
41
69
|
|
|
42
|
-
|
|
70
|
+
For checkout development, get the code and install the dependencies:
|
|
43
71
|
|
|
44
|
-
|
|
72
|
+
```sh
|
|
73
|
+
git clone https://github.com/cloving-ai/cloving-ai.git ~/cloving
|
|
74
|
+
cd ~/cloving
|
|
75
|
+
npm ci --ignore-scripts
|
|
76
|
+
```
|
|
45
77
|
|
|
46
|
-
|
|
78
|
+
The runtime dependencies include the Workflow SDK (`workflow`), its directive compiler (`@workflow/builders`), Solid Objects (`solid-objects`), Entities (`entities`) and Preact (`preact`), which the watch page loads. Startup runs the SDK compiler to transform workflow and step directives. Development dependencies are needed to build the package, but an installed tarball runs without them.
|
|
47
79
|
|
|
48
|
-
|
|
80
|
+
### The `cloving` command
|
|
49
81
|
|
|
50
|
-
|
|
51
|
-
|
|
82
|
+
For checkout development, put a launcher for `src/cli.ts` in a directory of the search path. The launcher must use exactly Node 26.9.0. This example is for a checkout in `~/cloving` and a launcher in `~/.local/bin`:
|
|
83
|
+
|
|
84
|
+
```sh
|
|
85
|
+
mkdir -p ~/.local/bin
|
|
86
|
+
cat > ~/.local/bin/cloving <<'EOF'
|
|
87
|
+
#!/bin/sh
|
|
88
|
+
exec node "$HOME/cloving/src/cli.ts" "$@"
|
|
89
|
+
EOF
|
|
90
|
+
chmod +x ~/.local/bin/cloving
|
|
91
|
+
cloving --version
|
|
52
92
|
```
|
|
53
93
|
|
|
54
|
-
|
|
94
|
+
If the `node` program of the search path has a different version, write the full path of the correct `node` program in the launcher.
|
|
95
|
+
|
|
96
|
+
To install a built tarball, build and pack it in the checkout:
|
|
55
97
|
|
|
56
|
-
|
|
98
|
+
```sh
|
|
99
|
+
npm run build
|
|
100
|
+
npm pack --ignore-scripts
|
|
101
|
+
```
|
|
57
102
|
|
|
58
|
-
|
|
103
|
+
Then install the resulting tarball in your project using its absolute location:
|
|
59
104
|
|
|
60
|
-
```
|
|
61
|
-
|
|
105
|
+
```sh
|
|
106
|
+
npm install --ignore-scripts --omit=dev /path/to/TARBALL
|
|
107
|
+
./node_modules/.bin/cloving --help
|
|
108
|
+
./node_modules/.bin/cloving start
|
|
62
109
|
```
|
|
63
110
|
|
|
64
|
-
|
|
111
|
+
The installed executable includes JavaScript for startup, the watch command and bundled workflows. It uses the installed runtime dependencies, including the SDK compiler, without a source checkout. Runtime state and generated workflow artifacts use the configured runtime location outside the installation. Installation scripts are unnecessary. The checkout launcher above remains supported, including its existing checkout self-update behavior; installing a tarball does not add package self-updates.
|
|
112
|
+
|
|
113
|
+
For a project-local tarball installation, use `./node_modules/.bin/cloving` wherever the examples below say `cloving`, or add your project's `node_modules/.bin` to the search path. After a build, `npm link` also supplies the executable.
|
|
114
|
+
|
|
115
|
+
## First run
|
|
116
|
+
|
|
117
|
+
This first run uses `develop-prompt` on a test repository. It needs no ticket command and no GitHub repository.
|
|
118
|
+
|
|
119
|
+
1. Make a test repository with one commit:
|
|
65
120
|
|
|
66
|
-
|
|
121
|
+
```sh
|
|
122
|
+
mkdir ~/cloving-trial
|
|
123
|
+
cd ~/cloving-trial
|
|
124
|
+
git init
|
|
125
|
+
echo "A test project." > README.md
|
|
126
|
+
git add README.md
|
|
127
|
+
git commit -m "Start the test project"
|
|
128
|
+
```
|
|
67
129
|
|
|
68
|
-
|
|
130
|
+
2. In terminal 1, in the test repository, start the service. Keep this terminal open:
|
|
69
131
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
git clone https://github.com/cloving-ai/cloving-cli.git
|
|
132
|
+
```sh
|
|
133
|
+
cloving start
|
|
73
134
|
```
|
|
74
135
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
136
|
+
`cloving start` copies the workflow file into a host project, compiles it there, and starts the service. Then it prints the commands for a second terminal.
|
|
137
|
+
|
|
138
|
+
3. Open the watch page on `http://127.0.0.1:3663/`.
|
|
139
|
+
|
|
140
|
+
4. In terminal 2, submit a run:
|
|
141
|
+
|
|
142
|
+
```sh
|
|
143
|
+
cloving run develop-prompt --prompt "Add a file HELLO.md with one line of text."
|
|
78
144
|
```
|
|
79
145
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
146
|
+
The command prints a committed receipt with the run ID. A receipt does not mean completed work.
|
|
147
|
+
|
|
148
|
+
5. The Claude worker does one Claude Code turn. Then the run opens one approval. Show the pending decisions:
|
|
149
|
+
|
|
150
|
+
```sh
|
|
151
|
+
cloving questions
|
|
84
152
|
```
|
|
85
153
|
|
|
86
|
-
|
|
154
|
+
The output has the approval text and the values that a decision command needs. The approval text has the round, the ticket ID, the branch, the commits, the changed files and the report of the worker.
|
|
87
155
|
|
|
88
|
-
|
|
89
|
-
cloving config
|
|
90
|
-
```
|
|
156
|
+
6. Read the diff before you decide. In the test repository, `git diff HEAD...BRANCH` shows the work of the branch.
|
|
91
157
|
|
|
92
|
-
|
|
158
|
+
7. Approve or deny the work:
|
|
93
159
|
|
|
94
|
-
|
|
160
|
+
```sh
|
|
161
|
+
cloving approve DECISION_REF --expected-revision N --generation N --subject-digest DIGEST
|
|
162
|
+
cloving deny DECISION_REF --text "FEEDBACK" --expected-revision N --generation N --subject-digest DIGEST
|
|
163
|
+
```
|
|
95
164
|
|
|
96
|
-
|
|
165
|
+
An approval completes the run. It does not merge the branch, so merge the branch yourself, for example with `git merge BRANCH`. A denial with a feedback text starts one more round.
|
|
97
166
|
|
|
98
|
-
|
|
167
|
+
8. `cloving status` lists the runs. `cloving status RUN_ID` shows one run with its reason, evidence and next action.
|
|
99
168
|
|
|
100
|
-
|
|
101
|
-
```bash
|
|
102
|
-
cloving config
|
|
103
|
-
```
|
|
169
|
+
### The service and its settings
|
|
104
170
|
|
|
105
|
-
|
|
171
|
+
`cloving start` starts one Cloving service for the git repository of the current directory, with the workflow host, the Claude worker and the watch page. `--repository` selects a different repository. Stop the service with Control-C. A stop of the service stops a turn in work; submit that ticket again.
|
|
106
172
|
|
|
107
|
-
|
|
108
|
-
```bash
|
|
109
|
-
cloving init
|
|
110
|
-
```
|
|
111
|
-
Options:
|
|
112
|
-
- `-s, --silent`: Run without asking for confirmation of submitting prompts
|
|
113
|
-
- `-m, --model <model>`: Select the model to use
|
|
173
|
+
The client commands find the service with no setting, because the two sides use the same default runtime directory (`~/.local/state/cloving/run`). `CLOVING_RUNTIME_DIR` selects a different place for the two sides. The directory above the runtime directory holds the authority state, the Local World data, the turn records and the git work trees.
|
|
114
174
|
|
|
115
|
-
|
|
175
|
+
`cloving watch` serves a read-only page on `http://127.0.0.1:3663/` (`--port` selects a different port). The page shows the runs, the events, the work of the Claude worker as it occurs, and each pending decision with its approve and deny commands. `cloving start` starts the page too; `CLOVING_WATCH_PORT` selects its port, and the value `off` starts none.
|
|
116
176
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
-
|
|
127
|
-
-
|
|
177
|
+
`cloving start` reads its settings from the environment. `cloving start --help` gives the form and the default of each setting:
|
|
178
|
+
|
|
179
|
+
- `CLOVING_RUNTIME_DIR`: the runtime directory.
|
|
180
|
+
- `CLOVING_TICKET_COMMAND`: the ticket command (see "Daily development").
|
|
181
|
+
- `CLOVING_NOTIFY_COMMAND`: a JSON list naming a command to notify the operator about pending decisions, blocked runs and failed runs. It has no default.
|
|
182
|
+
- `CLOVING_NEXT_COMMAND`: a JSON list of a command and its arguments that prints the next ready ticket ID for `--next`. It has no default.
|
|
183
|
+
- `CLOVING_CLAUDE_COMMAND`: a replacement of the `claude` command of the worker.
|
|
184
|
+
- `CLOVING_PROFILES`: a JSON file of named Claude turn profiles, read once when the service starts.
|
|
185
|
+
- `CLOVING_WATCH_PORT`: the port of the watch page, or `off`.
|
|
186
|
+
- `CLOVING_OWNERSHIP_LEASE_SECONDS` and `CLOVING_HOST_BOUND`: limits of the workflow host.
|
|
187
|
+
- `CLOVING_GH_COMMAND`, `CLOVING_CHECK_COMMAND` and `CLOVING_PRIVATE_TEXTS`: settings of `develop-issue`; the GitHub command and private-text list also apply to `develop-prd`.
|
|
188
|
+
|
|
189
|
+
A command setting is a JSON list of texts, for example `CLOVING_CHECK_COMMAND='["npm", "test"]'`.
|
|
190
|
+
|
|
191
|
+
The notify command receives no added argument. Its standard input receives one JSON object with `event`, `runId`, `workflowId`, `subject` and `body`. The body contains the decision or outcome text already shown by `cloving questions` or `cloving status`, with complete response commands, up to 4000 characters. The daemon checks every 15 seconds and records each event before calling the command. The first check with no notification record only records existing events. Records survive restarts; a failed command is logged once and never retried. Commands have 30 seconds to finish. A stop after recording an event but before sending it can lose that notification, and decisions opened and closed between checks can be missed.
|
|
128
192
|
|
|
129
|
-
|
|
193
|
+
## Daily development
|
|
130
194
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
195
|
+
`cloving start` copies the TypeScript files in `workflows/` into a host project and compiles them there. The bundled workflows are:
|
|
196
|
+
|
|
197
|
+
- `develop-prompt` takes the text of a task. Use it for a small task with no ticket, or for a first try in a new repository.
|
|
198
|
+
- `develop-ticket` takes a ticket ID and reads the ticket itself. Use it for the normal work on a ticket, when you want to read each diff and merge the branch yourself.
|
|
199
|
+
- `develop-issue` takes a ticket ID too, and sends the work through a GitHub pull request. Use it for a small ticket with clear criteria, in a GitHub repository that Greptile reviews and that has a check command. It is the workflow of the continuous process.
|
|
200
|
+
- `develop-prd` takes an idea, researches the code and web, reviews a draft PRD, and posts it as a GitHub issue. Set `CLOVING_PRIVATE_TEXTS` to a nonempty JSON list before starting the daemon. A refused post preserves the worktree and draft. A successful post removes the worktree and adds no label; read the issue and add `cloving: ready` when it is ready for implementation.
|
|
201
|
+
|
|
202
|
+
```sh
|
|
203
|
+
cloving start # terminal 1, in the repository
|
|
204
|
+
cloving run develop-ticket --ticket TICKET_ID # terminal 2
|
|
205
|
+
cloving run develop-issue --ticket TICKET_ID # the work goes through a pull request
|
|
206
|
+
cloving run develop-issue --next # select the next ready ticket
|
|
207
|
+
cloving run develop-prompt --prompt "the text of the task"
|
|
208
|
+
cloving run develop-prd --prompt "Show the cost of each run on the watch page"
|
|
209
|
+
cloving watch # the live page, also started by cloving start
|
|
210
|
+
cloving questions
|
|
211
|
+
cloving approve DECISION_REF --expected-revision N --generation N --subject-digest DIGEST
|
|
212
|
+
cloving deny DECISION_REF --text "FEEDBACK" --expected-revision N --generation N --subject-digest DIGEST
|
|
134
213
|
```
|
|
135
|
-
Options:
|
|
136
|
-
- `-s, --silent`: Run without asking for confirmation
|
|
137
|
-
- `-m, --model <model>`: Select the model to use
|
|
138
214
|
|
|
139
|
-
|
|
215
|
+
The rule: read the diff before you approve.
|
|
216
|
+
|
|
217
|
+
Claude turns have web research tools by default, an empty GitHub CLI configuration folder, and no GitHub token environment variables. This is not a sandbox: a turn can still find other credentials. The PRD refusal rules catch the listed private text and common sensitive forms; unlisted private names can pass. A `post-uncertain` result requires checking GitHub before trying another run.
|
|
218
|
+
|
|
219
|
+
### The ticket command
|
|
220
|
+
|
|
221
|
+
`CLOVING_TICKET_COMMAND` (a JSON list of texts) names the ticket command. The contract of a ticket command:
|
|
140
222
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
223
|
+
- It gets a ticket ID as its last argument and prints the text of the ticket.
|
|
224
|
+
- For `develop-issue`, a first line that starts with `# ` gives the title of the pull request. With no such line, the title is `Cloving task <cycle ID>`.
|
|
225
|
+
- For `develop-issue`, a line `GitHub issue: <owner>/<repository>#<number>` makes the pull request close that issue.
|
|
226
|
+
|
|
227
|
+
The daemon runs the ticket command when it admits a run. The printed text becomes the stored input of the run, so a later change of the ticket does not change the run. A ticket that the command does not give is refused with `ticket-not-available`. With no ticket command, `develop-ticket` is refused with `ticket-source-not-configured`. A ticket ID has letters, digits and the characters `. _ : -` only.
|
|
228
|
+
|
|
229
|
+
This example ticket command reads a GitHub issue. Save it as `~/.local/bin/github-ticket`, and make it executable:
|
|
230
|
+
|
|
231
|
+
```sh
|
|
232
|
+
#!/bin/sh
|
|
233
|
+
set -eu
|
|
234
|
+
repository=OWNER/REPOSITORY
|
|
235
|
+
title=$(gh issue view "$1" --repo "$repository" --json title --jq .title)
|
|
236
|
+
body=$(gh issue view "$1" --repo "$repository" --json body --jq .body)
|
|
237
|
+
printf '# %s\n\nGitHub issue: %s#%s\n\n%s\n' "$title" "$repository" "$1" "$body"
|
|
144
238
|
```
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
-
|
|
150
|
-
- `-p, --prompt <prompt>`: Specify the prompt to use
|
|
151
|
-
- `-f, --files <filenames...>`: Specify filenames of files with context to use for generating code
|
|
152
|
-
|
|
153
|
-
### Generating Shell Commands
|
|
154
|
-
|
|
155
|
-
Generate a shell command based on a prompt:
|
|
156
|
-
```bash
|
|
157
|
-
cloving generate shell
|
|
239
|
+
|
|
240
|
+
Then start the service with the setting:
|
|
241
|
+
|
|
242
|
+
```sh
|
|
243
|
+
CLOVING_TICKET_COMMAND='["github-ticket"]' cloving start
|
|
158
244
|
```
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
245
|
+
|
|
246
|
+
`cloving run develop-issue --next` and `cloving run develop-ticket --next` use the reserved ticket ID `next`, just like `--ticket next`. Set `CLOVING_NEXT_COMMAND` to a JSON list naming your selection command and its arguments. The daemon adds no argument. The command chooses a ready ticket in your tracker and prints its ID; the daemon trims it and reads the ticket with `CLOVING_TICKET_COMMAND`. Both commands share the resolver's 30-second deadline. Selection logic stays in your command, and each invocation submits only one run.
|
|
247
|
+
|
|
248
|
+
An empty selection gives `no-ready-ticket`; a failed command gives `next-ticket-not-available`. Missing configuration gives `next-source-not-configured`. Multiple IDs, an invalid ID, or `next` as the selected ID give `invalid-ticket-id`. Use only one of `--next`, `--ticket`, `--prompt` and `--input`.
|
|
249
|
+
|
|
250
|
+
### Review rounds of `develop-ticket` and `develop-prompt`
|
|
251
|
+
|
|
252
|
+
A run of `develop-ticket` or `develop-prompt` has one to three review rounds. Each round does one Claude Code turn in the work tree of the run, on the branch `cloving/<ticket id>-…`, and then opens one approval. The first round makes the work tree. The approval text has the round, the ticket ID, the branch, the commits, the changed files and the report of the worker. Read the diff before you decide. The decision has these results:
|
|
253
|
+
|
|
254
|
+
- An approval completes the run. It does not merge the branch. Merge the branch yourself.
|
|
255
|
+
- A denial with a feedback text (`--text`) in round 1 or 2 starts the next round. The Claude worker gets the feedback text and adds commits to the same branch.
|
|
256
|
+
- A denial with no text, or a denial in round 3, ends the run.
|
|
257
|
+
|
|
258
|
+
The worker is not confined. It runs the `claude` command of the search path as the current user, with file edits and shell commands permitted in the work tree and a spend limit of 5 USD for each turn. `CLOVING_CLAUDE_COMMAND` (a JSON list of texts) replaces the command.
|
|
259
|
+
|
|
260
|
+
Set `CLOVING_PROFILES` to a file such as:
|
|
261
|
+
|
|
262
|
+
```json
|
|
263
|
+
{
|
|
264
|
+
"profiles": {
|
|
265
|
+
"checker": {
|
|
266
|
+
"env": { "REVIEW_ONLY": "1", "TURN_NAME": "{turn}" },
|
|
267
|
+
"allowedTools": ["Read", "Grep", "Skill", "Agent"],
|
|
268
|
+
"maxBudgetUsd": 15,
|
|
269
|
+
"workflows": ["review-loop"]
|
|
270
|
+
},
|
|
271
|
+
"fixer": { "env": { "TURN_NAME": "{turn}" } }
|
|
272
|
+
}
|
|
273
|
+
}
|
|
162
274
|
```
|
|
163
|
-
Options:
|
|
164
|
-
- `-s, --silent`: Run without asking for confirmation of submitting prompts
|
|
165
|
-
- `-m, --model <model>`: Select the model to use
|
|
166
|
-
- `-p, --prompt <prompt>`: Specify the prompt to use
|
|
167
275
|
|
|
168
|
-
|
|
276
|
+
A workflow selects a profile with a `protectedEffect` request for capability `claude` and method `run-turn:checker` or `run-turn:fixer`. Profile names contain 1–119 ASCII letters, digits, hyphens or underscores. All fields are optional; `model` and `permissionMode` also override the corresponding Claude command flags. Unspecified fields keep the service defaults, and `run-turn` keeps the original command. Flags after `--` remain unchanged.
|
|
277
|
+
|
|
278
|
+
`workflows` restricts a profile to the service's registered workflow IDs; omitting it allows every workflow. Each turn receives its run ID and journal operation key joined with a hyphen in `CLOVING_TURN_ID`. That value replaces each `{turn}` in profile environment values. Variables added by one profile do not carry into the next turn. The four GitHub token variables and `GH_CONFIG_DIR` are forbidden in profiles; turns retain an empty GitHub configuration directory. Invalid files stop startup with `invalid-profiles`. Turns refuse unknown profiles with `unknown-profile`, disallowed workflows with `profile-not-allowed`, and Codex profiles with `profile-needs-claude`.
|
|
279
|
+
|
|
280
|
+
To run a Claude or Codex turn on an existing branch, a custom workflow sets
|
|
281
|
+
the effect target to `branch:feature-search`. The service finds that branch's
|
|
282
|
+
linked work tree in its own repository. The main checkout is excluded. Before
|
|
283
|
+
each turn, the work tree must be clean, including untracked files, submodule
|
|
284
|
+
changes and executable bits. Index entries marked assume-unchanged or
|
|
285
|
+
skip-worktree are refused even when unchanged. Missing or mismatched work trees
|
|
286
|
+
fail with `branch-worktree-not-found`; dirty work trees fail with
|
|
287
|
+
`branch-worktree-not-clean`. Branches beginning with `cloving/` and work trees
|
|
288
|
+
inside the managed work-tree directory fail with `branch-reserved`.
|
|
289
|
+
|
|
290
|
+
Cloving only inspects an existing branch work tree; the turn itself can edit
|
|
291
|
+
and commit there. Cloving does not create, stash, reset, clean, remove or delete
|
|
292
|
+
it or its branch. Results count commits and changed files from the first turn
|
|
293
|
+
of that run and target, including after a worker restart. Sequential runs have
|
|
294
|
+
separate starting commits; concurrent runs on one branch do not isolate their
|
|
295
|
+
commits. Index flags inside submodules and other settings that hide changes
|
|
296
|
+
are outside these checks. Every GitHub worker method refuses `branch:` targets
|
|
297
|
+
with `branch-target-not-supported`, so this target adds no Cloving push or merge
|
|
298
|
+
step. The bundled development workflows keep their existing targets.
|
|
299
|
+
|
|
300
|
+
### Pull requests of `develop-issue`
|
|
301
|
+
|
|
302
|
+
A run of `develop-issue` opens no approval. The GitHub worker makes the work tree from the newest commit of the default branch of `origin`. After the Claude turn, the worker pushes the branch and opens a pull request. The title and the closed issue come from the ticket text (see "The ticket command"). Then the worker waits for the Greptile review of the pushed commit, and asks for a review with a comment after 5 minutes.
|
|
303
|
+
|
|
304
|
+
When the ticket names a GitHub issue, the workflow adds `cloving: in progress` after preparing the work tree and removes `cloving: ready` and `cloving: blocked`. A blocked run adds `cloving: blocked` and removes `cloving: in progress`; a completed merge removes `cloving: in progress`. Operators add `cloving: ready`. Label failures leave the run's outcome unchanged. Cloving creates the labels it adds or removes with the fixed color `ededed`; existing labels have their color and description reset by `gh label create --force`.
|
|
305
|
+
|
|
306
|
+
At the confidence score 5/5, the worker merges the pull request with a merge commit, with no human approval. Then it removes the remote branch, the work tree and the local branch. With a lower score, the Claude worker gets the summary and the findings of the review for one more round. After three such rounds, or after 60 minutes with no review, the run stops and the pull request stays open.
|
|
169
307
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
308
|
+
The GitHub worker does not push a change that has the path of the home folder in a file or in a commit message. `CLOVING_PRIVATE_TEXTS` (a JSON list of texts) adds more texts to refuse, with no difference between capital and small letters. `CLOVING_CHECK_COMMAND` (a JSON list of texts) names a check that must pass in the work tree before a merge. `CLOVING_GH_COMMAND` replaces the `gh` command. The worker uses the `gh` login and the git credentials of the current user.
|
|
309
|
+
|
|
310
|
+
## Continuous process
|
|
311
|
+
|
|
312
|
+
In a continuous process, Cloving develops one ticket after the next with `develop-issue`. Use one terminal session for the service that stays open, for example a `tmux` session. Do these steps for each issue:
|
|
313
|
+
|
|
314
|
+
1. Write a small issue: one behavior, clear criteria that a test can check, and the first tests. The prompt "Write a ticket for Cloving" helps.
|
|
315
|
+
2. Run it: `cloving run develop-issue --ticket ISSUE_NUMBER`.
|
|
316
|
+
3. Follow the run on the watch page, or with `cloving status RUN_ID` and `cloving events RUN_ID --follow`.
|
|
317
|
+
4. Check the merge. The run completes when the GitHub worker merges the pull request. The watch page shows the number of the pull request of the run (`PR_NUMBER`). It is also `pullRequest.number` of the run in `http://127.0.0.1:3663/data.json`. The pull request number and the issue number are different.
|
|
318
|
+
- Make sure that the pull request is merged: `gh pr view PR_NUMBER --json state,mergedAt`.
|
|
319
|
+
- Make sure that the issue is closed: `gh issue view ISSUE_NUMBER --json state`.
|
|
320
|
+
5. Update the local `main`: `git switch main`, then `git pull --ff-only`.
|
|
321
|
+
6. When the repository is the Cloving checkout itself, also restart the service, so that it runs the new code. Stop it with Control-C, then start it again with the same settings.
|
|
322
|
+
7. Go to the next issue.
|
|
323
|
+
|
|
324
|
+
When a run stops and the pull request stays open, read the review. Fix the work yourself, or write a smaller issue.
|
|
325
|
+
|
|
326
|
+
Know these limits before you start:
|
|
327
|
+
|
|
328
|
+
- The cost limit of each Claude turn is 5 USD. A run of `develop-issue` can have up to four Claude turns. `CLOVING_CLAUDE_COMMAND` changes the command and its limit.
|
|
329
|
+
- The text of a pull request is public in a public repository. The worker gets an instruction to write no local file path in a file or in a commit message.
|
|
330
|
+
- `CLOVING_PRIVATE_TEXTS` adds texts that the GitHub worker refuses to push, for example the names of private projects. The path of the home folder is always refused.
|
|
331
|
+
- `CLOVING_CHECK_COMMAND` names the checks of the repository. Set it, because a merge at 5/5 has no human approval. With no setting, the merge occurs with no check.
|
|
332
|
+
|
|
333
|
+
## Prompts for a coding agent
|
|
334
|
+
|
|
335
|
+
Copy a prompt, replace the words in capital letters, and give it to a coding agent.
|
|
336
|
+
|
|
337
|
+
### Set up Cloving for a repository
|
|
338
|
+
|
|
339
|
+
```text
|
|
340
|
+
Set up Cloving for my repository REPOSITORY_PATH. Ask me for each value that you do not know. Do not push, publish or merge anything in this setup.
|
|
341
|
+
|
|
342
|
+
1. Check the platform: macOS on arm64, with the Node and npm versions of "engines" in package.json of Cloving. Check that git and the claude command work. If I want develop-issue, check that gh has a login and that Greptile reviews the GitHub repository.
|
|
343
|
+
2. If I have no Cloving checkout, clone https://github.com/cloving-ai/cloving-ai.git to ~/cloving. In the checkout, run: npm ci --ignore-scripts
|
|
344
|
+
3. Write a launcher ~/.local/bin/cloving that runs src/cli.ts of the checkout with the correct node program, and make it executable. Do not use npm link, and do not install the npm package with the name cloving. Make sure that ~/.local/bin is on the search path and that "cloving --version" works.
|
|
345
|
+
4. Ask me which tracker has my tickets. Write a ticket command for that tracker in ~/.local/bin. The command gets a ticket ID as its last argument and prints the text of the ticket. For develop-issue, the first line is "# " and the title, and one line is "GitHub issue: OWNER/REPOSITORY#NUMBER". Test the command with one ticket ID, and show me the output.
|
|
346
|
+
5. Start the service in a terminal session that stays open, for example a tmux session. In that session, in my repository, run: CLOVING_TICKET_COMMAND='["TICKET_COMMAND"]' cloving start
|
|
347
|
+
For develop-issue, also set CLOVING_CHECK_COMMAND to the checks of my repository. Give me the address of the watch page.
|
|
348
|
+
6. Make a first run with develop-prompt and a small task that I agree to. Show me the output of "cloving questions" and the diff of the branch. Do not approve or deny. I decide.
|
|
349
|
+
7. Then run my first ticket: cloving run develop-ticket --ticket TICKET_ID
|
|
350
|
+
Show me the diff again before I decide.
|
|
173
351
|
```
|
|
174
|
-
Options:
|
|
175
|
-
- `-f, --files <filenames...>`: Specify filenames of files with context to use for the chat
|
|
176
|
-
- `-t, --temperature <temperature>`: Set the temperature for the model (default 0.2)
|
|
177
|
-
- `-m, --model <model>`: Select the model to use
|
|
178
352
|
|
|
179
|
-
###
|
|
353
|
+
### Run a continuous process
|
|
354
|
+
|
|
355
|
+
```text
|
|
356
|
+
Run a continuous process with Cloving and develop-issue in my repository REPOSITORY_PATH. The Cloving service runs in the terminal session SESSION_NAME. Do the issues ISSUE_LIST one at a time, in this order.
|
|
357
|
+
|
|
358
|
+
For each issue:
|
|
359
|
+
1. Read the issue. Do not change it.
|
|
360
|
+
2. Run: cloving run develop-issue --ticket ISSUE_NUMBER
|
|
361
|
+
ISSUE_NUMBER is the number of the issue. Record the run ID.
|
|
362
|
+
3. Follow the run with "cloving status RUN_ID" and "cloving events RUN_ID --follow".
|
|
363
|
+
4. When the run completes, get the number of its pull request (PR_NUMBER). It is pullRequest.number of the run in http://127.0.0.1:3663/data.json, and the watch page shows it too. Then:
|
|
364
|
+
- Make sure that the pull request is merged: gh pr view PR_NUMBER --json state,mergedAt
|
|
365
|
+
- Make sure that the issue is closed: gh issue view ISSUE_NUMBER --json state
|
|
366
|
+
5. Update the local main branch: git switch main, then git pull --ff-only
|
|
367
|
+
6. If the repository is the Cloving checkout itself, restart the service in its terminal session, so that it runs the new code. Stop it with Control-C, then start it again with the same settings.
|
|
368
|
+
7. Run the checks of the repository on the new main branch.
|
|
369
|
+
8. Add a record of the run to RECORD_FILE, outside the repository: the issue, the run ID, the pull request, the merge commit, the number of rounds and the result of the checks.
|
|
370
|
+
9. Go to the next issue.
|
|
371
|
+
|
|
372
|
+
Stop and ask me when:
|
|
373
|
+
- an issue is not small, or has no criteria that a test can check;
|
|
374
|
+
- a run stops, or its pull request stays open;
|
|
375
|
+
- the checks fail on the main branch after a merge;
|
|
376
|
+
- a step needs a change of the settings or of the credentials, or work in a different repository;
|
|
377
|
+
- a step needs a force push, a change of the history, or a publication.
|
|
378
|
+
|
|
379
|
+
Do not merge a pull request yourself. Do not approve or deny for me.
|
|
380
|
+
```
|
|
180
381
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
382
|
+
### Write a ticket for Cloving
|
|
383
|
+
|
|
384
|
+
```text
|
|
385
|
+
Help me write a ticket for Cloving. A Claude Code worker gets the full text of the ticket and no other context. Ask me questions until each part is clear. Then write the ticket in Markdown with these parts:
|
|
386
|
+
|
|
387
|
+
# TITLE
|
|
388
|
+
One line. For develop-issue, it becomes the title of the pull request.
|
|
389
|
+
GitHub issue: OWNER/REPOSITORY#NUMBER
|
|
390
|
+
Only for develop-issue. The pull request closes this issue.
|
|
391
|
+
## Problem
|
|
392
|
+
What is wrong now, with facts.
|
|
393
|
+
## Desired outcome
|
|
394
|
+
What is true when the work is done.
|
|
395
|
+
## Concrete scenario
|
|
396
|
+
One example from the start to the end, with real values.
|
|
397
|
+
## Scope
|
|
398
|
+
The changes, with the names of the files, commands and functions that you know.
|
|
399
|
+
## Non-goals
|
|
400
|
+
What the work must not change.
|
|
401
|
+
## Acceptance criteria
|
|
402
|
+
A numbered list. A test can check each criterion.
|
|
403
|
+
## First tests
|
|
404
|
+
The first tests to write. Each test fails before the change.
|
|
405
|
+
|
|
406
|
+
Rules:
|
|
407
|
+
- One ticket has one behavior. If the work needs more than one pull request, split the ticket.
|
|
408
|
+
- Write no secret, no private data and no local file path. For develop-issue, the ticket text and the branch become public.
|
|
409
|
+
- Use one term for one thing.
|
|
184
410
|
```
|
|
185
|
-
Options:
|
|
186
|
-
- `-f, --files <filenames...>`: Specify filenames of files with context to use for generating code
|
|
187
|
-
- `-t, --temperature <temperature>`: Set the temperature for the model (default 0.2)
|
|
188
|
-
- `-m, --model <model>`: Select the model to use
|
|
189
411
|
|
|
190
|
-
|
|
412
|
+
### Find workflows in your chats
|
|
413
|
+
|
|
414
|
+
```text
|
|
415
|
+
Find workflows in my chats with coding agents, and write a draft Cloving workflow for one of them.
|
|
191
416
|
|
|
192
|
-
|
|
417
|
+
Rules:
|
|
418
|
+
- Read only the chats that I select. Ask me for the list first. Do not read other chats.
|
|
419
|
+
- Keep the chat text and private data out of the repository. Do not copy chat text, names of persons, secrets or local paths into a file of the repository. Keep your notes outside the repository.
|
|
193
420
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
421
|
+
Steps:
|
|
422
|
+
1. In the selected chats, find sequences of steps that repeat. For each sequence, list the steps, the tool of each step (for example git, a test command, gh or a model), and each decision of a person (for example "approve the diff").
|
|
423
|
+
2. Show me the list, and ask me which sequence to use.
|
|
424
|
+
3. Map each step that changes something outside the workflow to protectedEffect, with a capability and a method. Map each decision of a person to decisionGate.
|
|
425
|
+
4. Use only the capabilities that have a worker: claude (method run-turn) and github. Put each step that needs a different capability in a list of open points, not in the draft.
|
|
426
|
+
5. Write the draft in the form of workflows/develop-ticket.ts of the Cloving checkout: an exported async function with the directive "use workflow", and the step helpers from the subpaths of cloving/workflows.
|
|
427
|
+
6. Write a list of the human decisions in the draft: for each decisionGate, the question, the person who decides, and the result of each answer.
|
|
428
|
+
7. Write workflow tests with a fake step bridge, in the form of test/develop-workflow-fixture.ts.
|
|
429
|
+
8. Tell me which changes of the Cloving code the draft needs before the service can run it. The section "Develop a workflow" of the Cloving README lists them.
|
|
197
430
|
```
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
431
|
+
|
|
432
|
+
## Develop a workflow
|
|
433
|
+
|
|
434
|
+
A workflow is a TypeScript file in the form of `workflows/develop-ticket.ts`:
|
|
435
|
+
|
|
436
|
+
- An exported async function with the directive `"use workflow"` as its first statement. The directive needs the compiler of the Workflow SDK, not only TypeScript.
|
|
437
|
+
- The first argument is the input of the run. A resolver of the daemon makes it, for example `cycleId`, `ticketId`, `ticket` and `repository`. After a decision, the host calls the function again with the decision (`gateId`, `decision` and `answer`) as the second argument. The function must examine the decision before it asks for an effect, as `decided()` in `workflows/develop-ticket.ts` does. If it does not, it does the work of round 1 again.
|
|
438
|
+
- The step helpers come from the subpaths of `cloving/workflows`: `protectedEffect` from `cloving/workflows/steps/protected-effect`, `decisionGate` from `cloving/workflows/steps/decision-gate` and `loadCycle` from `cloving/workflows/steps/load-cycle`. The type `CycleOutcome` comes from `cloving/workflows`. An import of `cloving/workflows` starts no service.
|
|
439
|
+
- `protectedEffect` asks the daemon for one effect of a capability, for example a Claude turn. `decisionGate` opens a decision for a person.
|
|
440
|
+
- The function returns a `CycleOutcome`: `waiting_for_decision`, `handoff_requested` or `blocked`.
|
|
441
|
+
|
|
442
|
+
```ts
|
|
443
|
+
import type { CycleOutcome } from "cloving/workflows";
|
|
444
|
+
import { decisionGate } from "cloving/workflows/steps/decision-gate";
|
|
445
|
+
import { protectedEffect } from "cloving/workflows/steps/protected-effect";
|
|
446
|
+
|
|
447
|
+
export async function developTicket(
|
|
448
|
+
input: { readonly cycleId: string; readonly ticket: string },
|
|
449
|
+
decision?: {
|
|
450
|
+
readonly gateId: string;
|
|
451
|
+
readonly decision: string;
|
|
452
|
+
readonly answer: string | null;
|
|
453
|
+
},
|
|
454
|
+
): Promise<CycleOutcome> {
|
|
455
|
+
"use workflow";
|
|
456
|
+
if (decision?.decision === "approved")
|
|
457
|
+
return {
|
|
458
|
+
kind: "handoff_requested",
|
|
459
|
+
cycleId: input.cycleId,
|
|
460
|
+
promotionId: `cloving-${input.cycleId}`,
|
|
461
|
+
};
|
|
462
|
+
if (decision !== undefined)
|
|
463
|
+
return {
|
|
464
|
+
kind: "blocked",
|
|
465
|
+
cycleId: input.cycleId,
|
|
466
|
+
reason: "The operator denied the work.",
|
|
467
|
+
evidenceId: decision.gateId,
|
|
468
|
+
};
|
|
469
|
+
const turn = await protectedEffect({
|
|
470
|
+
scope: { phase: "implement", operation: "claude-turn", round: 1 },
|
|
471
|
+
capability: "claude",
|
|
472
|
+
method: "run-turn",
|
|
473
|
+
target: input.cycleId,
|
|
474
|
+
payload: input.ticket,
|
|
475
|
+
units: 1,
|
|
476
|
+
});
|
|
477
|
+
if (turn.kind !== "completed")
|
|
478
|
+
return {
|
|
479
|
+
kind: "blocked",
|
|
480
|
+
cycleId: input.cycleId,
|
|
481
|
+
reason: "The Claude turn did not complete.",
|
|
482
|
+
evidenceId: "claude-turn",
|
|
483
|
+
};
|
|
484
|
+
const gate = await decisionGate({
|
|
485
|
+
gateId: "review-1",
|
|
486
|
+
kind: "approval",
|
|
487
|
+
prompt: "Review the work of the Claude worker.",
|
|
488
|
+
});
|
|
489
|
+
if (gate.kind !== "opened")
|
|
490
|
+
return {
|
|
491
|
+
kind: "blocked",
|
|
492
|
+
cycleId: input.cycleId,
|
|
493
|
+
reason: "The review gate did not open.",
|
|
494
|
+
evidenceId: "review-1",
|
|
495
|
+
};
|
|
496
|
+
return {
|
|
497
|
+
kind: "waiting_for_decision",
|
|
498
|
+
cycleId: input.cycleId,
|
|
499
|
+
decisionId: gate.decisionId,
|
|
500
|
+
};
|
|
501
|
+
}
|
|
201
502
|
```
|
|
202
|
-
Options:
|
|
203
|
-
- `-f, --files <filenames...>`: Specify filenames of files to estimate tokens for
|
|
204
503
|
|
|
205
|
-
|
|
504
|
+
In this example, an approval completes the run and a denial ends it. `workflows/develop-ticket.ts` also starts one more round after a denial with a feedback text.
|
|
206
505
|
|
|
207
|
-
|
|
208
|
-
```bash
|
|
209
|
-
cloving generate context
|
|
210
|
-
```
|
|
211
|
-
Options:
|
|
212
|
-
- `-f, --files <filenames...>`: Specify filenames of files with context
|
|
506
|
+
The workflow tests run the workflow function with a fake step bridge (`test/develop-workflow-fixture.ts`). The fixture resolves `cloving/workflows` to the files of `src`, records each effect request and gate request, and gives the results of a scenario. `test/develop-ticket-workflow.test.ts` and `test/develop-issue-workflow.test.ts` use it.
|
|
213
507
|
|
|
214
|
-
|
|
508
|
+
`cloving start` compiles the TypeScript files in the application's `workflows` folder. Each file may contain one workflow function, and function names must be unique across files. The four built-in registrations (`develop-ticket`, `develop-issue`, `develop-prd` and `develop-prompt`) keep their existing input contracts and resolvers.
|
|
215
509
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
510
|
+
To register another workflow, put `<name>.declaration.json` beside `<name>.ts`:
|
|
511
|
+
|
|
512
|
+
```json
|
|
513
|
+
{
|
|
514
|
+
"workflowId": "review-run",
|
|
515
|
+
"effectLimit": 14,
|
|
516
|
+
"capabilities": ["claude"],
|
|
517
|
+
"input": {
|
|
518
|
+
"maximumBytes": 65536,
|
|
519
|
+
"fields": {
|
|
520
|
+
"prompt": { "type": "string" },
|
|
521
|
+
"rounds": { "type": "integer", "minimum": 1, "maximum": 10, "optional": true }
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
}
|
|
219
525
|
```
|
|
220
|
-
Options:
|
|
221
|
-
- `-s, --silent`: Run without asking for confirmation
|
|
222
|
-
- `-f, --files <filenames...>`: Specify filenames for the unit tests
|
|
223
|
-
- `-m, --model <model>`: Select the model to use
|
|
224
526
|
|
|
225
|
-
|
|
527
|
+
The ID accepts 1–64 letters, digits or hyphens. The effect limit is 1–100; capabilities must contain `claude`, `github`, or both. The input byte limit is 1–1048576, subject to the service's own limit. Fields accept nonempty strings, integers with optional inclusive bounds, or booleans. Fields are required unless `optional` is `true`; unknown fields are rejected. Bounds apply only to integers.
|
|
528
|
+
|
|
529
|
+
After startup, `cloving status` lists the declared ID. Submit JSON with `cloving run review-run --input input.json`. The function receives `{ cycleId, repository, input }`, where `cycleId` is `task-` followed by 12 characters derived from the command ID, `repository` is the service repository, and `input` retains the checked JSON values. Invalid input is rejected before a run starts. Invalid declarations or duplicate workflow IDs or function names stop startup.
|
|
226
530
|
|
|
227
|
-
|
|
531
|
+
## Development of Cloving
|
|
532
|
+
|
|
533
|
+
```sh
|
|
534
|
+
npm ci --ignore-scripts
|
|
535
|
+
npm run check:setup
|
|
536
|
+
npm run build
|
|
537
|
+
node dist/src/cli.js --help
|
|
538
|
+
npm pack --ignore-scripts
|
|
539
|
+
```
|
|
228
540
|
|
|
229
|
-
|
|
230
|
-
- `-V, --version`: Output the version number
|
|
231
|
-
- `-h, --help`: Display help for command
|
|
541
|
+
`npm pack` prints the file name of the tarball. Install it into a separate project with `npm install --ignore-scripts --omit=dev /absolute/path/to/TARBALL`, then run `./node_modules/.bin/cloving --version` or `./node_modules/.bin/cloving start`. The package includes the emitted CLI, start program, compiler and bundled workflows; startup uses the installed runtime dependencies. The package has no installation hooks. An import of `cloving/workflows` gives the step helpers `loadCycle`, `protectedEffect` and `decisionGate`, and starts no service.
|
|
232
542
|
|
|
233
|
-
|
|
234
|
-
- `config`: Configure Cloving with your API key and models to use
|
|
235
|
-
- `init`: Setup Cloving in the current directory
|
|
236
|
-
- `chat`: Start an interactive chat with Cloving
|
|
237
|
-
- `tokens`: Estimate the number of tokens in the current working directory or specified files
|
|
238
|
-
- `proxy`: Start a proxy server to use with Cloving
|
|
239
|
-
- `models`: List available models
|
|
240
|
-
- `commit`: Alias for cloving generate commit
|
|
241
|
-
- `generate`: Generate various items like unit-tests and code reviews
|
|
242
|
-
- `commit`: Generate a commit message and commit the changes
|
|
243
|
-
- `code`: Generate code based on a prompt
|
|
244
|
-
- `context`: Generate context for building a prompt outside of cloving
|
|
245
|
-
- `shell`: Generate a shell command based on a prompt
|
|
246
|
-
- `unit-tests`: Generate unit tests
|
|
247
|
-
- `review`: Review the code for committed changes
|
|
543
|
+
`npm run check` and `npm run test:concurrency` currently reject admission because the complete quality policy is not implemented. Setup checks are not product acceptance. State and retained releases will live outside the package installation; installing or updating the package does not activate a daemon or migrate state.
|
|
248
544
|
|
|
249
|
-
|
|
250
|
-
- `-s, --silent`: Run the command without asking for confirmation of submitting prompts
|
|
251
|
-
- `-m, --model <model>`: Select the model to use (e.g., openai, claude, ollama, ollama:llama3, claude:claude-3-5-sonnet-20240620)
|
|
545
|
+
Run `npm run test:scale` on an otherwise idle machine to measure authority opening at 1,000, 10,000 and 50,000 events. This command runs the benchmark alone, without coverage; the regular test suite excludes it. The fixture uses completed runs with budgets, gates and released continuations. It requires each opening to take less than two seconds and the largest opening to take less than eight times the 10,000-event opening. Replay uses the pure reducer with run-scoped projections and preserves shared effect and lease state. Large effect histories, growing gate or pending-intent state within one run, and cancelled-run recovery still require separate scaling work; this benchmark does not establish their bounds. The generated-history parity and tamper tests compare replay with the full reducer and cover every event type.
|
|
252
546
|
|
|
253
|
-
|
|
547
|
+
`npm run check:quality` checks the npm manifest, lock and installed versions, regenerates TypeScript output in memory, inventories first-party files, and runs strict compilation, the proposed module catalog, workflow/effect boundaries, suppression and test-integrity checks, formatting, typed lint, structural checks, clone detection and the regular local test suite. Production modules require at least 90% line, statement and function coverage and 85% branch coverage per file. Coverage uses native V8 ranges mapped to the syntax tree of the exact Node-stripped source; unimported production files fail. Class and named object types allow at most 24 callable members; interfaces allow 10. Clone checks support ordinary TypeScript and JavaScript; JSX is rejected until separately qualified. `npm run check:lint`, `npm run check:format` and `npm run test:quality` run individual development checks.
|
|
254
548
|
|
|
255
|
-
|
|
549
|
+
Set `CLOVING_CHECK_TIME_FACTOR` to a whole number from 1 to 5 (default 1) to multiply only the developer gate test and coverage command time limits.
|
|
256
550
|
|
|
257
|
-
|
|
551
|
+
The catalog and checker configuration are local proposals. The bounded SDK artifact, dependency-surface, production-coverage and mandatory-test inventory components have local qualification fixtures. Protected activation of their records, verifier execution and hooks remain pending. Dependency snapshots and supplied review records cannot activate a candidate. The local quality command cannot accept a product candidate. Static workflow checks are not isolation or replay proof. Deterministic sequencing fixtures qualify the test mechanism; they do not prove ownership or storage concurrency in the service.
|
|
258
552
|
|
|
259
|
-
|
|
553
|
+
The coverage profile supports strip-only TypeScript and JavaScript (`ts`, `mts`, `cts`, `js`, `mjs`, `cjs`). It rejects source-map and coverage-ignore patterns interpreted by the provider, including patterns inside strings. Native V8 limitations around throwing calls and default arguments remain; coverage does not replace behavioral assertions. Production roles come from the complete module catalog, independently of which files tests import. Nested npm workspaces and unsupported dependency directory links fail explicitly until qualified.
|
|
260
554
|
|
|
261
|
-
|
|
555
|
+
For trusted development fixtures, `npm run build:workflows -- SOURCE_DIRECTORY OUTPUT_DIRECTORY` runs the selected directive compiler with deterministic manifest ordering. Run the compiler in an isolated fixture project; its output directory must resolve that project's installed `workflow` dependency. Compiler caches and generated handlers stay outside the application source tree. Generated handlers are development artifacts and do not grant authority to execute effects.
|
|
262
556
|
|
|
263
|
-
|
|
264
|
-
- Special thanks to the open-source community for inspiration and support.
|
|
557
|
+
SDK qualification uses a fixed logical output path and an empty root TypeScript configuration. Its separate input preflight rejects ancestor/nested compiler configuration, outside first-party inputs, dynamic/CommonJS loading and ambiguous local declaration/runtime resolution. Record the full installed tool/helper closure and every generated handler, manifest and debug artifact, then regenerate at the same logical path and compare preserved bytes. The direct build command does not authenticate these records. Real packed-helper execution is qualified with a disposable prototype.
|