@orchestrator-claude/definitions 3.15.1 → 3.16.0

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.
@@ -1,7 +1,9 @@
1
1
  #!/bin/bash
2
2
  # gate-guardian.sh — ADR-013 Phase 5 Hook (JSON Structured Output)
3
3
  # Trigger: PreToolUse on mcp__orchestrator-tools__advancePhase
4
- # Purpose: Evaluate gate before phase advance. FAIL-CLOSED: blocks when uncertain.
4
+ # Purpose: Guard IMPLEMENT phase advance (requires human approval). ALLOWs all other phases.
5
+ # Note: POST /gate/evaluate endpoint removed (TD-127). Phase transitions are now handled
6
+ # atomically by setPendingAction() via the ping-pong-enforcer hook.
5
7
  #
6
8
  # Output: JSON with permissionDecision (deny/allow) + additionalContext
7
9
  # Exit 0 with JSON = structured decision
@@ -22,6 +24,25 @@ TARGET_PHASE=$(orch_json_field "$STDIN_DATA" "tool_input.targetPhase")
22
24
 
23
25
  orch_log "GATE-GUARDIAN: workflow=$WORKFLOW_ID targetPhase=$TARGET_PHASE"
24
26
 
27
+ # ADR-013 Phase 6: Check workflow mode before gate evaluation
28
+ # quick and interactive modes skip gate evaluation entirely
29
+ if [ -n "$WORKFLOW_ID" ]; then
30
+ MODE=$(orch_get_workflow_mode "$WORKFLOW_ID" 2>/dev/null) || MODE=""
31
+ orch_log "GATE-GUARDIAN: workflow=$WORKFLOW_ID mode=${MODE:-legacy}"
32
+
33
+ if [ "$MODE" = "quick" ]; then
34
+ orch_log "GATE-GUARDIAN: ALLOW (quick mode skips gate evaluation)"
35
+ echo "{\"hookSpecificOutput\":{\"hookEventName\":\"PreToolUse\",\"permissionDecision\":\"allow\",\"additionalContext\":\"Gate to '${TARGET_PHASE}' allowed: quick mode skips gate evaluation.\"}}"
36
+ exit 0
37
+ fi
38
+
39
+ if [ "$MODE" = "interactive" ]; then
40
+ orch_log "GATE-GUARDIAN: ALLOW (interactive mode skips gate evaluation, artifact gates not required)"
41
+ echo "{\"hookSpecificOutput\":{\"hookEventName\":\"PreToolUse\",\"permissionDecision\":\"allow\",\"additionalContext\":\"Gate to '${TARGET_PHASE}' allowed: interactive mode skips artifact gate evaluation.\"}}"
42
+ exit 0
43
+ fi
44
+ fi
45
+
25
46
  # FAIL-CLOSED: if we can't parse input, DENY
26
47
  if [ -z "$WORKFLOW_ID" ] || [ -z "$TARGET_PHASE" ]; then
27
48
  orch_log "GATE-GUARDIAN: DENY (could not parse input)"
@@ -56,24 +77,8 @@ if [ "$TARGET_LOWER" = "implement" ]; then
56
77
  fi
57
78
  fi
58
79
 
59
- # Evaluate gate via API — FAIL-CLOSED on failure
60
- GATE_RESULT=$(orch_evaluate_gate "$WORKFLOW_ID" "$TARGET_PHASE" 2>/dev/null) || GATE_RESULT=""
61
- if [ -z "$GATE_RESULT" ]; then
62
- orch_log "GATE-GUARDIAN: DENY (gate evaluation failed)"
63
- echo "{\"hookSpecificOutput\":{\"hookEventName\":\"PreToolUse\",\"permissionDecision\":\"deny\",\"permissionDecisionReason\":\"Gate Guardian: Gate evaluation failed for phase '${TARGET_PHASE}'.\",\"additionalContext\":\"Required artifacts may be missing. Complete the current phase before advancing.\"}}"
64
- exit 0
65
- fi
66
-
67
- PASSED=$(orch_json_field "$GATE_RESULT" "passed")
68
-
69
- if [ "$PASSED" = "true" ]; then
70
- orch_log "GATE-GUARDIAN: ALLOW (gate passed for $TARGET_PHASE)"
71
- echo "{\"hookSpecificOutput\":{\"hookEventName\":\"PreToolUse\",\"permissionDecision\":\"allow\",\"additionalContext\":\"Gate to '${TARGET_PHASE}' passed.\"}}"
72
- exit 0
73
- fi
74
-
75
- # Gate failed
76
- REASONS=$(orch_json_field "$GATE_RESULT" "reasons")
77
- orch_log "GATE-GUARDIAN: DENY (gate failed: $REASONS)"
78
- echo "{\"hookSpecificOutput\":{\"hookEventName\":\"PreToolUse\",\"permissionDecision\":\"deny\",\"permissionDecisionReason\":\"Gate Guardian: Gate to '${TARGET_PHASE}' did not pass.\",\"additionalContext\":\"Reasons: ${REASONS}. Complete current phase requirements before advancing.\"}}"
80
+ # Non-IMPLEMENT phases: ALLOW directly.
81
+ # Phase transitions are handled atomically by setPendingAction() via ping-pong-enforcer.
82
+ orch_log "GATE-GUARDIAN: ALLOW (non-IMPLEMENT phase, no gate evaluation required)"
83
+ echo "{\"hookSpecificOutput\":{\"hookEventName\":\"PreToolUse\",\"permissionDecision\":\"allow\",\"additionalContext\":\"Gate to '${TARGET_PHASE}' allowed.\"}}"
79
84
  exit 0
@@ -100,18 +100,20 @@ orch_get_next_action() {
100
100
  -H "X-Project-ID: $PROJECT_ID" 2>/dev/null
101
101
  }
102
102
 
103
- # Call evaluateGate for a workflow
104
- orch_evaluate_gate() {
103
+ # ADR-013 Phase 6: Get the mode of a workflow (quick/standard/full/interactive)
104
+ # Returns the mode string, or empty string for legacy workflows (mode=null)
105
+ # Returns exit code 1 on network/auth error
106
+ orch_get_workflow_mode() {
105
107
  local workflow_id="$1"
106
- local target_phase="$2"
107
108
  local token
108
109
  token=$(orch_get_token) || return 1
109
110
 
110
- curl -sf --max-time 10 -X POST "${API_URL}/api/v1/workflows/${workflow_id}/gate/evaluate" \
111
- -H "Content-Type: application/json" \
111
+ local resp
112
+ resp=$(curl -sf --max-time 3 "${API_URL}/api/v1/workflows/${workflow_id}/status" \
112
113
  -H "Authorization: Bearer $token" \
113
- -H "X-Project-ID: $PROJECT_ID" \
114
- -d "{\"targetPhase\":\"${target_phase}\"}" 2>/dev/null
114
+ -H "X-Project-ID: $PROJECT_ID" 2>/dev/null) || return 1
115
+
116
+ orch_json_field "$resp" "mode"
115
117
  }
116
118
 
117
119
  # Extract a field from JSON string using node
package/manifest.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schema": "orchestrator-definitions/v1",
3
3
  "namespace": "orchestrator",
4
- "version": "3.15.1",
5
- "generatedAt": "2026-03-19T17:36:07.853Z",
4
+ "version": "3.16.0",
5
+ "generatedAt": "2026-03-19T22:13:52.697Z",
6
6
  "definitions": {
7
7
  "agents": [
8
8
  {
@@ -245,7 +245,7 @@
245
245
  "slug": "gate-guardian",
246
246
  "file": "hooks/gate-guardian.sh",
247
247
  "version": "1.0.0",
248
- "checksum": "sha256:7a5add785c53b4040bfde3ba68af8d2f43f65ecc101b600793f6f47a3e411f15",
248
+ "checksum": "sha256:1631a7be326e1099698f6492caead2f05423582869bba0f69a50754055e1be2d",
249
249
  "supersedes": null,
250
250
  "metadata": {}
251
251
  },
@@ -253,7 +253,7 @@
253
253
  "slug": "orch-helpers",
254
254
  "file": "hooks/orch-helpers.sh",
255
255
  "version": "1.0.0",
256
- "checksum": "sha256:0038a622374b5c88b9c674a8fc49744a72752c390db3e45a00948e6676e42959",
256
+ "checksum": "sha256:906d72e990592bcac675d01c8e8f7ea2df42794b59492992fd8a15975b50608d",
257
257
  "supersedes": null,
258
258
  "metadata": {}
259
259
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orchestrator-claude/definitions",
3
- "version": "3.15.1",
3
+ "version": "3.16.0",
4
4
  "description": "Built-in definitions (agents, skills, hooks, workflows, KB seeds) for the Orchestrator ecosystem",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",