@orchestraworks/cli 0.5.2 → 0.5.4

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.
Files changed (128) hide show
  1. package/README.md +1 -1
  2. package/dist/cli/api/compute-provider-check.d.ts +29 -0
  3. package/dist/cli/api/compute-provider-check.js +207 -0
  4. package/dist/cli/api/tail.d.ts +66 -0
  5. package/dist/cli/api/tail.js +564 -0
  6. package/dist/cli/main.d.ts +5 -1
  7. package/dist/cli/main.js +22 -0
  8. package/dist/constructs/agent.d.ts +10 -0
  9. package/dist/constructs/agent.js +39 -4
  10. package/dist/constructs/environment.d.ts +29 -1
  11. package/dist/constructs/environment.js +28 -1
  12. package/dist/constructs/skill.d.ts +6 -1
  13. package/dist/constructs/skill.js +21 -2
  14. package/dist/engine/reconcile.js +15 -1
  15. package/dist/generated/cli-commands.json +1646 -198
  16. package/dist/generated/cli-dispatch.js +9 -0
  17. package/dist/generated/managed-skills.d.ts +2 -0
  18. package/dist/generated/managed-skills.js +18 -0
  19. package/dist/index.d.ts +1 -1
  20. package/docs/REFERENCE.md +21 -1
  21. package/node_modules/@orchestraworks/client/dist/apis/OrganizationInvitationsApi.d.ts +29 -0
  22. package/node_modules/@orchestraworks/client/dist/apis/OrganizationInvitationsApi.js +96 -0
  23. package/node_modules/@orchestraworks/client/dist/esm/apis/OrganizationInvitationsApi.d.ts +29 -0
  24. package/node_modules/@orchestraworks/client/dist/esm/apis/OrganizationInvitationsApi.js +96 -0
  25. package/node_modules/@orchestraworks/client/dist/esm/models/ComputeProvider.d.ts +3 -3
  26. package/node_modules/@orchestraworks/client/dist/esm/models/CreateEnvironmentRequest.d.ts +13 -0
  27. package/node_modules/@orchestraworks/client/dist/esm/models/CreateEnvironmentRequest.js +5 -0
  28. package/node_modules/@orchestraworks/client/dist/esm/models/CreateOrganizationInvitationRequest.d.ts +2 -2
  29. package/node_modules/@orchestraworks/client/dist/esm/models/Environment.d.ts +13 -0
  30. package/node_modules/@orchestraworks/client/dist/esm/models/Environment.js +5 -0
  31. package/node_modules/@orchestraworks/client/dist/esm/models/EnvironmentHook.d.ts +38 -0
  32. package/node_modules/@orchestraworks/client/dist/esm/models/EnvironmentHook.js +45 -0
  33. package/node_modules/@orchestraworks/client/dist/esm/models/EnvironmentHooks.d.ts +39 -0
  34. package/node_modules/@orchestraworks/client/dist/esm/models/EnvironmentHooks.js +44 -0
  35. package/node_modules/@orchestraworks/client/dist/esm/models/EnvironmentHooksRequest.d.ts +39 -0
  36. package/node_modules/@orchestraworks/client/dist/esm/models/EnvironmentHooksRequest.js +44 -0
  37. package/node_modules/@orchestraworks/client/dist/esm/models/EnvironmentProvisionSpec.d.ts +2 -1
  38. package/node_modules/@orchestraworks/client/dist/esm/models/EnvironmentProvisionSpecRequest.d.ts +2 -1
  39. package/node_modules/@orchestraworks/client/dist/esm/models/EnvironmentSnapshot.d.ts +19 -0
  40. package/node_modules/@orchestraworks/client/dist/esm/models/EnvironmentSnapshot.js +7 -0
  41. package/node_modules/@orchestraworks/client/dist/esm/models/Machine.d.ts +7 -1
  42. package/node_modules/@orchestraworks/client/dist/esm/models/Machine.js +2 -0
  43. package/node_modules/@orchestraworks/client/dist/esm/models/OrganizationAuthPolicy.d.ts +1 -1
  44. package/node_modules/@orchestraworks/client/dist/esm/models/OrganizationInvitation.d.ts +14 -1
  45. package/node_modules/@orchestraworks/client/dist/esm/models/OrganizationInvitation.js +8 -1
  46. package/node_modules/@orchestraworks/client/dist/esm/models/Principal.d.ts +6 -0
  47. package/node_modules/@orchestraworks/client/dist/esm/models/Principal.js +2 -0
  48. package/node_modules/@orchestraworks/client/dist/esm/models/UpdateEnvironmentRequest.d.ts +13 -0
  49. package/node_modules/@orchestraworks/client/dist/esm/models/UpdateEnvironmentRequest.js +5 -0
  50. package/node_modules/@orchestraworks/client/dist/esm/models/UpdateOrganizationInvitationRequest.d.ts +2 -1
  51. package/node_modules/@orchestraworks/client/dist/esm/models/UpdateOrganizationInvitationRequest.js +2 -1
  52. package/node_modules/@orchestraworks/client/dist/esm/models/User.d.ts +6 -0
  53. package/node_modules/@orchestraworks/client/dist/esm/models/User.js +4 -0
  54. package/node_modules/@orchestraworks/client/dist/esm/models/index.d.ts +3 -0
  55. package/node_modules/@orchestraworks/client/dist/esm/models/index.js +3 -0
  56. package/node_modules/@orchestraworks/client/dist/models/ComputeProvider.d.ts +3 -3
  57. package/node_modules/@orchestraworks/client/dist/models/CreateEnvironmentRequest.d.ts +13 -0
  58. package/node_modules/@orchestraworks/client/dist/models/CreateEnvironmentRequest.js +5 -0
  59. package/node_modules/@orchestraworks/client/dist/models/CreateOrganizationInvitationRequest.d.ts +2 -2
  60. package/node_modules/@orchestraworks/client/dist/models/Environment.d.ts +13 -0
  61. package/node_modules/@orchestraworks/client/dist/models/Environment.js +5 -0
  62. package/node_modules/@orchestraworks/client/dist/models/EnvironmentHook.d.ts +38 -0
  63. package/node_modules/@orchestraworks/client/dist/models/EnvironmentHook.js +52 -0
  64. package/node_modules/@orchestraworks/client/dist/models/EnvironmentHooks.d.ts +39 -0
  65. package/node_modules/@orchestraworks/client/dist/models/EnvironmentHooks.js +51 -0
  66. package/node_modules/@orchestraworks/client/dist/models/EnvironmentHooksRequest.d.ts +39 -0
  67. package/node_modules/@orchestraworks/client/dist/models/EnvironmentHooksRequest.js +51 -0
  68. package/node_modules/@orchestraworks/client/dist/models/EnvironmentProvisionSpec.d.ts +2 -1
  69. package/node_modules/@orchestraworks/client/dist/models/EnvironmentProvisionSpecRequest.d.ts +2 -1
  70. package/node_modules/@orchestraworks/client/dist/models/EnvironmentSnapshot.d.ts +19 -0
  71. package/node_modules/@orchestraworks/client/dist/models/EnvironmentSnapshot.js +7 -0
  72. package/node_modules/@orchestraworks/client/dist/models/Machine.d.ts +7 -1
  73. package/node_modules/@orchestraworks/client/dist/models/Machine.js +2 -0
  74. package/node_modules/@orchestraworks/client/dist/models/OrganizationAuthPolicy.d.ts +1 -1
  75. package/node_modules/@orchestraworks/client/dist/models/OrganizationInvitation.d.ts +14 -1
  76. package/node_modules/@orchestraworks/client/dist/models/OrganizationInvitation.js +8 -1
  77. package/node_modules/@orchestraworks/client/dist/models/Principal.d.ts +6 -0
  78. package/node_modules/@orchestraworks/client/dist/models/Principal.js +2 -0
  79. package/node_modules/@orchestraworks/client/dist/models/UpdateEnvironmentRequest.d.ts +13 -0
  80. package/node_modules/@orchestraworks/client/dist/models/UpdateEnvironmentRequest.js +5 -0
  81. package/node_modules/@orchestraworks/client/dist/models/UpdateOrganizationInvitationRequest.d.ts +2 -1
  82. package/node_modules/@orchestraworks/client/dist/models/UpdateOrganizationInvitationRequest.js +2 -1
  83. package/node_modules/@orchestraworks/client/dist/models/User.d.ts +6 -0
  84. package/node_modules/@orchestraworks/client/dist/models/User.js +4 -0
  85. package/node_modules/@orchestraworks/client/dist/models/index.d.ts +3 -0
  86. package/node_modules/@orchestraworks/client/dist/models/index.js +3 -0
  87. package/node_modules/@orchestraworks/client/package.json +1 -1
  88. package/package.json +4 -4
  89. package/skills/orchestra/SKILL.md +167 -42
  90. package/skills/orchestra-fdk/SKILL.md +112 -545
  91. package/skills/orchestra-fdk/references/authoring.md +29 -2
  92. package/skills/orchestra-fdk/references/environment.md +295 -41
  93. package/skills/orchestra-fdk/references/integrations/analytics.md +18 -0
  94. package/skills/orchestra-fdk/references/integrations/ci-cd.md +20 -0
  95. package/skills/orchestra-fdk/references/integrations/cloud.md +19 -0
  96. package/skills/orchestra-fdk/references/integrations/code-repo.md +76 -0
  97. package/skills/orchestra-fdk/references/integrations/databases.md +22 -0
  98. package/skills/orchestra-fdk/references/integrations/dependencies.md +29 -0
  99. package/skills/orchestra-fdk/references/integrations/design.md +18 -0
  100. package/skills/orchestra-fdk/references/integrations/feature-flags.md +19 -0
  101. package/skills/orchestra-fdk/references/integrations/incident.md +29 -0
  102. package/skills/orchestra-fdk/references/integrations/issue-tracker.md +65 -0
  103. package/skills/orchestra-fdk/references/integrations/knowledge-base.md +43 -0
  104. package/skills/orchestra-fdk/references/integrations/messaging.md +38 -0
  105. package/skills/orchestra-fdk/references/integrations/observability.md +36 -0
  106. package/skills/orchestra-fdk/references/integrations/secrets-managers.md +25 -0
  107. package/skills/orchestra-fdk/references/integrations/support-desk.md +31 -0
  108. package/skills/orchestra-fdk/references/phases/0-start.md +62 -0
  109. package/skills/orchestra-fdk/references/phases/1-discover.md +111 -0
  110. package/skills/orchestra-fdk/references/phases/2-plan.md +157 -0
  111. package/skills/orchestra-fdk/references/phases/3-connect.md +99 -0
  112. package/skills/orchestra-fdk/references/phases/4-build.md +159 -0
  113. package/skills/orchestra-fdk/references/phases/5-prove.md +107 -0
  114. package/skills/orchestra-fdk/references/phases/6-handover.md +42 -0
  115. package/skills/orchestra-fdk/references/troubleshooting.md +128 -0
  116. package/templates/bug-fix/agents/bugfix.md +1 -1
  117. package/templates/bug-fix/main.ts +1 -1
  118. package/templates/engineering-team/README.md +45 -181
  119. package/templates/engineering-team/agents/engineer-agent.md +10 -7
  120. package/templates/engineering-team/agents/manager-agent.md +23 -120
  121. package/templates/engineering-team/inputs.json +1 -3
  122. package/templates/engineering-team/lib/environment.ts +10 -90
  123. package/templates/engineering-team/lib/inputs.ts +5 -97
  124. package/templates/engineering-team/main.ts +22 -69
  125. package/templates/todo-factory/agents/bugfix.md +1 -1
  126. package/templates/todo-factory/main.ts +1 -1
  127. package/templates/engineering-team/agents/engineer-bare.md +0 -22
  128. package/templates/engineering-team/onboarding/create-score-metrics.sh +0 -33
@@ -0,0 +1,128 @@
1
+ # Troubleshooting
2
+
3
+ A phase's exit check failed. Each part below names what you see, what it means, and what to do. Find the
4
+ cause before you change anything, then run the exit check again. Read the facts first, with these commands.
5
+ They only read:
6
+
7
+ | What | Command |
8
+ |---|---|
9
+ | A conversation | `npx orchestra sessions get <session id> --output json`: `status`, `failureCode`, `failureReason` |
10
+ | Its messages and turns | `npx orchestra sessions list-items <session id> --output json`: rows in `data` |
11
+ | The machines of an environment | `npx orchestra machines list --environment-id <id> --output json` |
12
+ | One machine | `npx orchestra machines get <machine id> --output json`: `status`, `failureReason` |
13
+ | What the cloud saw | `npx orchestra machines get-diagnostics <machine id> --output json` |
14
+
15
+ On a turn's message item, `turnState` says where the turn is (`QUEUED`, `IN_FLIGHT`, `COMPLETED`, `FAILED`,
16
+ `INTERRUPTED` and others). A failed turn carries `failureCode`, a short code, and `failureReason`, a
17
+ sentence. Read both.
18
+
19
+ ## A machine does not start
20
+
21
+ A machine's `status` is `PENDING`, `RUNNING`, `STOPPING`, `STOPPED`, `OFFLINE`, `TERMINATED` or `FAILED`.
22
+ A `FAILED` machine names the cause in `failureReason`:
23
+
24
+ - **`registration_timeout`.** The machine started, but the worker inside it never connected back before the
25
+ deadline. The deadline is the substrate's start time plus, with a setup script, 10 minutes and a margin.
26
+ Look at `get-diagnostics`: `substrate.events` and `substrate.outOfMemory`. A custom image or `command`
27
+ that does not start the worker gives this. Prove the image with `worker check` (`authoring.md`).
28
+ - **`worker_never_registered`.** The cloud said the machine was serving, and nothing connected. Read it as
29
+ `registration_timeout`.
30
+ - **`setup failed: ...`.** The setup script exited with a code, timed out, or gave no result. The platform
31
+ does not keep the script's output. Run the script on this computer, in the local environment
32
+ (`environment.md`, section 4), and fix it there.
33
+ - **`disk missing: ...`.** A declared disk was not mounted.
34
+
35
+ A turn that failed for its machine carries one of these `failureCode` values:
36
+ `machine_image_unavailable` (the image did not download: check the tag and the pull key Secret),
37
+ `machine_capacity_exhausted`, `machine_storage_unavailable` or `machine_start_failed`. A failed start check
38
+ before any machine is made names the missing capability in `failureReason`.
39
+
40
+ `503` with `NO_ROOM` on a machine create or resume: there is no room now. Try again after the
41
+ `Retry-After` time.
42
+
43
+ ## A request from the machine is refused
44
+
45
+ The network edge answers the agent, not you. The agent sees one of these:
46
+
47
+ - `403` with `destination is not allowed: <host>` and `code` `CREDENTIAL_UNAVAILABLE`. No rule allows the
48
+ host. `details.reason` is `policy_denied` or `ambiguous_match` (two rules match with equal weight). The
49
+ answer does not name a rule.
50
+ - `403 egress identity missing` or `egress destination mismatch`, or `502 egress broker unavailable` or
51
+ `egress upstream unavailable`: a fault on the path, not the rules.
52
+
53
+ To check the rules the machine has now, read `egressPolicy` in `get-diagnostics`: `defaultAction`, and each
54
+ rule's name, priority, action, hosts and paths. Fix the rules in code and apply. Rules reach running
55
+ machines at once. A `403` from the provider itself, such as GitHub, means the key is there but lacks a
56
+ permission or scope.
57
+
58
+ ## An integration's check command fails
59
+
60
+ The check command of an integration file (`integrations/`) runs on an agent's machine:
61
+
62
+ - `403` with `destination is not allowed`: see the part above.
63
+ - `403` with `ambiguous_match`: two rules on one host, at one priority, add the keys of two different
64
+ platform connections, and the session belongs to neither. Keep the two priorities equal, and set
65
+ `attributeConnection: true` on the agent target of each trigger that starts the sessions. Or put the two
66
+ connections in separate environments. Do not raise one rule's priority: that connection's key then goes on
67
+ every request to the host, also for a session of the other connection.
68
+ - Two Secret rules (not connections) on one host at one priority do not refuse: the first declared wins.
69
+ Give each its own `paths`.
70
+ - `401` from the provider: the edge added a credential in a form the provider does not take. Check the
71
+ recipe: `Bearer` or `Basic`, the user name of a Basic pair, or the header name. Check that the token file
72
+ was loaded at the last apply.
73
+ - `403` from the provider: the credential is there, but its scopes or its user's rights are too narrow.
74
+ - No answer from a host inside the team's network: hosted machines reach the internet only
75
+ (`environment.md`, section 5, part C).
76
+
77
+ ## A machine in the team's own cloud cannot reach a service
78
+
79
+ A compute provider's machine (the Launcher) has no network edge of ours in front of it, so no Secret is
80
+ added to its requests. The team sets every credential on the machine (`environment.md`, section 5, part
81
+ C, "Tokens on a compute provider's machines").
82
+
83
+ - A `401` from the model provider, or "Invalid API key": the worker service's environment does not have
84
+ the model sign-in. On Windows, read the `SfdkWorker` service's `Environment` registry value.
85
+ - The value is set, but the agent still sends the old one: the worker read its environment before the
86
+ boot step set it. Restart the worker service (`Restart-Service SfdkWorker` on Windows).
87
+ - A token in the environment's `env` (`provisionSpec.env`): move it to the worker service's environment.
88
+ The platform stores and returns `env` values, and the VM's startup data carries them in plain text.
89
+ - The boot step cannot read the team's Key Vault: the Launcher attaches no managed identity to its VMs.
90
+ The team's automation attaches one, and finds the VMs by the tags `orchestra-launcher` and
91
+ `orchestra-machine`.
92
+ - No answer from a host: the team's own network or firewall blocks it. Our rules can only allow there.
93
+
94
+ ## The sign-in stops working
95
+
96
+ - `this sign-in has expired or been revoked` or `The stored login is not accepted`: run
97
+ `npx orchestra auth login` again (`phases/0-start.md`).
98
+ - A token typed at the `--no-browser` prompt cannot renew itself. Sign in through the browser instead.
99
+ - A network error never means a new sign-in is needed. Try the command again.
100
+
101
+ ## A session does not start: limits and credits
102
+
103
+ - `429` with `code` `QUOTA_EXCEEDED` names a `dimension`, its `limit` and the `current` count:
104
+ `CONCURRENT_SESSIONS`, `CONCURRENT_MACHINES`, `CREDITS` or `MACHINE_MINUTES_MONTHLY_LIMIT`. Wait for
105
+ running sessions to end, or send the developer to **Settings › Plan & usage** in the console.
106
+ - A turn that failed this way carries `failureCode` `quota_exceeded`.
107
+ - A trigger that could not start a session shows the reason on the trigger's `lastDecision`. A work item
108
+ shows a feed note: `No session started for <agent>: ...`.
109
+ - The model gateway answers `403` with `credits_exhausted` or `budget_exceeded`, in the model provider's
110
+ own error shape, with a `[sfdk]` prefix on the message.
111
+ - `403` with `PLAN_FEATURE_DISABLED`: the plan does not include the feature. This is not a credit problem.
112
+
113
+ `maxSessionsPerMachine` is not an error. A session past it starts another machine.
114
+
115
+ ## `fdk diff` shows something you did not expect
116
+
117
+ Each row is `create`, `update`, `refused`, `value-write-pending` or `no-change`. Blocked rows print
118
+ `will fail — <reason>`, and apply refuses them before it writes anything.
119
+
120
+ - **`value-write-pending` on every diff.** A Secret whose value comes from the shell. Apply writes it each
121
+ time, because it cannot read the old value. This is expected.
122
+ - **An `update` you did not write.** Someone changed the row in the console or with a command. Apply sets it
123
+ back to the code. Write the change into the code if it must stay.
124
+ - **Rules or Secrets about to be deleted.** The shell does not hold the tokens. Load the token file
125
+ (`set -a; . ~/.config/orchestra/tokens.env; set +a`) and run the diff again. Do this before every apply, a
126
+ repair apply included. When the code declares a token's Secret only if its variable is set, an apply
127
+ without the variable takes that Secret and its rules off every machine.
128
+ - **Orphans.** Rows with the factory's label that the code no longer declares. Apply does not delete them.
@@ -6,5 +6,5 @@ You fix bugs in the GitHub repository <repository>, one bug per conversation. Th
6
6
  3. Fix it with the smallest change and run the test again. Keep the passing output.
7
7
  4. Push a branch as soon as the test passes, then open a pull request against the default branch with gh:
8
8
  what was wrong, the fix, and the tests you ran.
9
- 5. Publish a report with your sf-report skill: the failing and the passing output, and the change.
9
+ 5. Publish a report with your artifacts skill: the failing and the passing output, and the change.
10
10
  End with the pull request's link and the report's slug.
@@ -136,7 +136,7 @@ new Agent(factory, "bugfix", {
136
136
  modelSettings: { enableModelGateway: true },
137
137
  instructions: readFile("agents/bugfix.md").replaceAll("<repository>", REPOSITORY),
138
138
  skills: [
139
- Skill.fromId(factory, "skill_sf-report"),
139
+ Skill.fromId(factory, "skill_artifacts"),
140
140
  new Skill(factory, "codebase", { source: "skills/codebase" }),
141
141
  ],
142
142
  });
@@ -10,36 +10,29 @@ in any of its pipelines can be assigned to any of its agents.
10
10
 
11
11
  | Path | What it holds |
12
12
  |---|---|
13
- | `main.ts` | The Manager Agent, Engineer Agent sm, md and lg, and Engineer Agent bare for the Bootstrap's baseline; their machines; the model gateway key, and the two token Secrets once they are connected; the Onboarding, Bugs, Features and Support pipelines. |
13
+ | `main.ts` | The Manager Agent and Engineer Agent sm, md and lg; their machines; the model gateway key; the Bugs, Features and Support pipelines. |
14
14
  | `agents/` | The agents' instructions. |
15
- | `lib/` | The inputs, the machines, the keys and the network rules, used by `main.ts`. |
15
+ | `lib/` | The inputs, the machines, the model gateway key and the network rules, used by `main.ts`. |
16
16
 
17
- | Agent | Slug | Harness | Model | Machine | Bitbucket and Jira |
18
- |---|---|---|---|---|---|
19
- | Manager Agent | `manager-agent` | claude | `claude-opus-5-5` | `manager-work-lg`: 32 CPU, 64 GB | Tokens added |
20
- | Engineer Agent lg | `engineer-lg` | claude | `claude-opus-5-5` | `engineer-work-lg`: 32 CPU, 64 GB | Blocked |
21
- | Engineer Agent md | `engineer-md` | codex | `gpt-6.1-sol` | `engineer-work-md`: 16 CPU, 32 GB | Blocked |
22
- | Engineer Agent sm | `engineer-sm` | codex | `gpt-6-luna` | `engineer-work-sm`: 2 CPU, 4 GB | Blocked |
23
- | Engineer Agent bare | `engineer-bare` | claude | `claude-opus-5-5` | `engineer-work-lg`: 32 CPU, 64 GB | Blocked |
17
+ | Agent | Slug | Harness | Model | Machine |
18
+ |---|---|---|---|---|
19
+ | Manager Agent | `manager-agent` | claude | `claude-opus-5-5` | `manager-work-lg`: 32 CPU, 64 GB |
20
+ | Engineer Agent lg | `engineer-lg` | claude | `claude-opus-5-5` | `engineer-work-lg`: 32 CPU, 64 GB |
21
+ | Engineer Agent md | `engineer-md` | codex | `gpt-6.1-sol` | `engineer-work-md`: 16 CPU, 32 GB |
22
+ | Engineer Agent sm | `engineer-sm` | codex | `gpt-6-luna` | `engineer-work-sm`: 2 CPU, 4 GB |
24
23
 
25
- Work goes to Engineer Agent lg first. Engineer Agent sm and md take no work of their own until replays show
26
- that a kind of work passes on them. Engineer Agent md reviews Engineer Agent lg's changes from the start.
27
- Engineer Agent bare takes only the Bootstrap's baseline replays. Its instructions, in `agents/engineer-bare.md`,
28
- hold no work loop, and it never gets a codebase skill.
24
+ Work goes to Engineer Agent lg first. Engineer Agent sm and md take no work of their own until a person
25
+ says that a kind of work may go to them. Engineer Agent md reviews Engineer Agent lg's changes from the start.
29
26
 
30
27
  | Pipeline | Item prefix | Stages, in order | What it holds |
31
28
  |---|---|---|---|
32
- | Onboarding | `onbd` | Todo, In progress, Needs review, Done | Set up, Bootstrap and every Replay item. |
33
- | Bugs | `bug` | Triage, Parked, In progress, In review, Done, Won't fix | Bugs. Parked holds a bug that waits until the factory is commissioned (the Bootstrap passes), or a bug a person has set aside. |
29
+ | Bugs | `bug` | Triage, Parked, In progress, In review, Done, Won't fix | Bugs. Parked holds a bug a person has set aside. |
34
30
  | Features | `feat` | Backlog, Todo, In progress, In review, Done | Features. |
35
31
  | Support | `supp` | Triage, Answering, Waiting on requester, Resolved, Closed | Questions from the team's users. |
36
32
 
37
- An item may move from any stage to any other. An agent moves an item to Needs review or In review when its
38
- work is ready for a person, or when it needs a decision.
39
-
40
- The Onboarding pipeline is temporary. It is retired after commissioning, when another pipeline replaces it.
41
- To delete it, first close or move its open items, and remove every trigger and workflow that names it. The
42
- platform refuses to delete a pipeline that still has any of them.
33
+ An item may move from any stage to any other. An agent moves an item to its review stage when its work is
34
+ ready for a person, or when it needs a decision. The review stage is In review in Bugs and Features, and
35
+ Waiting on requester in Support.
43
36
 
44
37
  Every machine:
45
38
 
@@ -49,28 +42,19 @@ Every machine:
49
42
  - is open to every host, and adds the model gateway key on `models.orchestraworks.ai` at the network edge,
50
43
  so no agent holds it.
51
44
 
52
- Once the tokens are connected, the Manager Agent's machine also adds the Bitbucket token on
53
- `api.bitbucket.org` (Bearer) and `bitbucket.org` (git over HTTPS, Basic auth), and the Jira token on the Jira
54
- site host (Basic auth over the account email and the token).
55
-
56
- The Engineer Agents' machines deny `bitbucket.org` and `api.bitbucket.org`, and the Jira site host once it is
57
- set in `inputs.json`. They carry no token. A deny rule wins over the open default.
58
-
59
45
  An environment declared in code keeps only what it declares. So the model gateway rule is declared here on
60
46
  every machine. If you remove it, `orchestra fdk apply` removes it from the platform too.
61
47
 
62
48
  ## How the Engineer Agents get the code
63
49
 
64
- Until commissioning, the Engineer Agents cannot reach Bitbucket or Jira. The code reaches them as a *git
65
- bundle*, a single file that holds a repository's history:
50
+ The code reaches the Engineer Agents as a *git bundle*, a single file that holds a repository's history. The
51
+ bundle fixes the commit the work starts from, so the author and the reviewer of a change read the same code:
66
52
 
67
- 1. The Manager Agent clones the repository and cuts a bundle holding history only up to the commit the work
68
- starts from. For a replay, that is the commit before the fix. For real work, it is the tip of the default
69
- branch.
53
+ 1. The Manager Agent clones the repository, from the address in `inputs.json` or in the item, and cuts a bundle holding history only up to the tip of the
54
+ default branch.
70
55
  2. It uploads the bundle as a File, and writes `Code bundle: <file id>` in the item.
71
56
  3. The Engineer Agent downloads it with `orchestra files get-content`, clones from it, and answers with a patch
72
- uploaded as another File. Platform calls are not governed by the machine's network rules, so the
73
- download works on a blocked machine.
57
+ uploaded as another File.
74
58
 
75
59
  Their instructions in `agents/` carry these steps.
76
60
 
@@ -89,66 +73,28 @@ ends the turn, so the notice the platform sends when an item is assigned away st
89
73
  fixes each confirmed P1 and P2 finding, in at most two rounds, and reports the evidence on the item.
90
74
  `agents/engineer-agent.md` carries these steps. To check UI work in a browser, turn on the Chromium block in `lib/setup.sh`.
91
75
 
92
- ## Commissioning
93
-
94
- *Commissioning* is when the Engineer Agents start real work on the tracker. Then:
95
-
96
- 1. In `main.ts`, give Engineer Agent sm, md and lg the codebase skill the Bootstrap made. The Bootstrap's
97
- Done comment names the skill's slug. Import `Skill` from `"@orchestraworks/cli"`, and add
98
- `skills: [Skill.fromSlug(factory, "<skill slug>")]` to those three agents' props. Engineer Agent bare
99
- never gets the skill. An apply sets each agent back to this code, so without this line the
100
- apply takes the skill away.
101
- 2. In `main.ts`, change the Engineer Agents' `access` from `"blocked"` to `"tokens"`. The deny rules go and
102
- the token rules come.
103
- 3. Update the Engineer Agent instructions in `agents/engineer-agent.md`. They say the agent cannot reach
104
- Bitbucket or Jira and gets its code as a bundle. Tell it to clone the repository and use the tracker.
105
- 4. Apply when no replay is running. The network edge reads an environment's rules live, so the change
106
- reaches every machine at once, machines already running included. A replay that can reach Bitbucket or
107
- Jira can find the real fix.
108
-
109
76
  ## Inputs
110
77
 
111
- Nothing about one team is written in the code. It comes from two places:
112
-
113
- - `inputs.json`: the repository address, its default branch, the Jira site host and the Jira account email.
114
- - The shell, at `orchestra fdk apply` only: `ORCHESTRA_FDK_BITBUCKET_TOKEN` and `ORCHESTRA_FDK_JIRA_TOKEN`. No file in this folder holds
115
- them.
116
-
117
- Every value may be empty. A token is connected only when its shell variable and the inputs it needs are set:
118
-
119
- | Token | Shell variable | Inputs it needs |
120
- |---|---|---|
121
- | Bitbucket | `ORCHESTRA_FDK_BITBUCKET_TOKEN` | `repositoryUrl`, `repositoryDefaultBranch` |
122
- | Jira | `ORCHESTRA_FDK_JIRA_TOKEN` | `jiraSite`, `jiraEmail` |
123
-
124
- A token that is not connected has no Secret and no rule. Synth prints one warning that names each value still
125
- missing, and goes on. Until both are connected, the Manager Agent's instructions say what is not connected,
126
- and tell it to ask for it in Needs review.
127
-
128
- ## Run it: two applies
129
-
130
- The first apply comes before any token or input, so you see the agents and pipelines first.
78
+ The factory declares no code host and no tracker, so it needs no token. `inputs.json` holds two values, and
79
+ both may be empty:
131
80
 
132
- 1. Write the factory and apply it:
81
+ - `repositoryUrl`: the address `git clone` takes, on any git host. When it is empty, the Manager Agent takes
82
+ the address from each item.
83
+ - `repositoryDefaultBranch`: the branch pull requests go to.
133
84
 
134
- ```bash
135
- npm install
136
- npm run typecheck
137
- npx orchestra fdk diff
138
- npx orchestra fdk apply
139
- ```
85
+ The machines carry no token for the code host. A public repository clones without one. For a private one,
86
+ the Manager Agent asks on the item how to reach it.
140
87
 
141
- This creates the five agents, their machines with the model gateway key, and the four pipelines. Synth
142
- warns that the repository and the tracker are not connected yet.
88
+ ## Run it
143
89
 
144
- 2. Connect the repository and the tracker, and apply again:
145
- 1. Fill in `inputs.json`.
146
- 2. Save the two tokens in the shell: `export ORCHESTRA_FDK_BITBUCKET_TOKEN=...` and `export ORCHESTRA_FDK_JIRA_TOKEN=...`.
147
- 3. Run `npx orchestra fdk diff`, then `npx orchestra fdk apply`. The token Secrets and the Manager Agent's token rules are
148
- added, and the warning goes away.
90
+ ```bash
91
+ npm install
92
+ npm run typecheck
93
+ npx orchestra fdk diff
94
+ npx orchestra fdk apply
95
+ ```
149
96
 
150
- Run every later apply with the two token variables set. An apply without them takes the token rules off the
151
- Manager Agent's machine again.
97
+ This creates the four agents, their machines with the model gateway key, and the three pipelines.
152
98
 
153
99
  ## After apply: steps the code cannot declare
154
100
 
@@ -165,101 +111,19 @@ Manager Agent's machine again.
165
111
  `agent-worker` included, and add the new one:
166
112
  `{"roleAssignments":[<the existing entries>, {"roleId":"<agent-manager role id>"}]}`.
167
113
  5. Send it: `npx orchestra organization-memberships update <membership id> --body @grant.json`.
168
- 2. **Create the score metrics.** The kit cannot declare a metric. Run this once, from this folder:
169
- `bash onboarding/create-score-metrics.sh`. It stops at the first error, and a second run skips each
170
- metric that exists. It runs `npx orchestra metrics create` once for each metric:
171
- - `replay-pass`: true or false, and true is better. It says whether every change was right.
172
- - `replay-f05`: a number from 0 to 1, and higher is better. It is the replay's F0.5.
173
- - `replay-precision`: a number from 0 to 1. It is the part of the agent's changes that match the real fix,
174
- with the work loop's extra tests and doc comments counted as neutral.
175
- - `replay-raw-precision`: a number from 0 to 1. It is the same part, with those tests and doc comments
176
- counted as changes.
177
- - `replay-recall`: a number from 0 to 1. It is the part of the real fix that the agent made.
178
-
179
- The Manager Agent writes a replay's scores into them on its Replay item, with
180
- `orchestra metrics write-value <metric> --value <value> --body score.json`. The command has no flag for the
181
- subject or the labels, so `score.json` holds both:
182
- `{"subject":{"kind":"workItem","id":"<item id>"},"labels":{"arm":"full"}}`. The label `arm` is `full` for
183
- an Engineer Agent lg replay and `bare` for an Engineer Agent bare replay.
184
- 3. **Create the first Onboarding items.** The kit cannot declare items. Create them in the Onboarding pipeline, in
185
- this order:
186
- - "Set up", assigned to the Manager Agent. Assigning it starts the work.
187
- - "Bootstrap", left unassigned in Todo. Copy the two values of "The Bootstrap threshold" below into its
188
- description.
189
-
190
- Once Set up is in Done, the developer's coding agent (Claude Code or Codex) or a person assigns Bootstrap
191
- to `manager-agent`.
192
-
193
- ## Bootstrap
194
-
195
- The Bootstrap is one Onboarding item. It teaches the Engineer Agents this codebase, then tests them on past
196
- pull requests they have not seen. It is a one-time step before commissioning.
197
-
198
- 1. **Choose a cut date T.** The test set is 10 recent merged pull requests after T, about 5 bug fixes and 5
199
- features. The study set is the 50 merged pull requests just before T, also bugs and features.
200
- 2. **Study.** The Manager Agent reads the code and its history only as they were at T. The default branch
201
- already holds the 10 test changes, so reading past T would teach their fixes. It checks out the commit at
202
- T into a study copy that holds no later commit, and reads `git log` only up to T. There it reads the 50
203
- and writes a direction map: the implicit rules, the hidden connections, the bug and feature map, the
204
- directions, and where to look first. It skips `AGENTS.md` and `CLAUDE.md`, because the harness already loads them. Each entry cites two
205
- or more commits or files, and an entry with one example is labeled a guess.
206
- 3. **Apply.** It writes the map into a codebase skill on the platform, and points `engineer-sm`,
207
- `engineer-md` and `engineer-lg` at it, by name. It never points `engineer-bare` at it, because the bare
208
- replays measure an agent with no skill. That makes one new version of each of the three.
209
- 4. **Test.** It creates one Replay item for each of the 10, with a bundle cut at the commit before the fix,
210
- and assigns it to `engineer-lg`. These are the *full* replays: the codebase skill and the work loop. When
211
- the report is ready, or when it is stuck, the Engineer Agent assigns the item back to `manager-agent`,
212
- which scores it:
213
- - A replay fails when any change is wrong. Otherwise its score is F0.5, over precision and recall
214
- against the real fix.
215
- - The work loop's extra tests and doc comments are neutral: neither a match nor a mismatch. Raw
216
- precision counts them as changes, and is recorded too.
217
- - The Manager Agent also runs the real pull request's tests on the change. For a feature, it judges
218
- whether the change does what the ticket asks.
219
- - The scores are values of the five score metrics on the Replay item, labeled `arm=full`.
220
- 5. **Baseline.** At the same time, it creates a second Replay item for each of the same 10, and assigns it to
221
- `engineer-bare`. These are the *bare* replays: the raw ticket text only, with no codebase skill, no
222
- triage notes and no work loop. They are scored with the same rule, and their values are labeled
223
- `arm=bare`.
224
- 6. **Calibrate.** Assigning the Bootstrap item back resumes its conversation, which knows the first scores.
225
- So the Manager Agent creates a separate "Calibrate" item and assigns it to itself, which starts a new
226
- conversation. That conversation re-scores 3 of the 10 full replays without reading the first scores, adds
227
- its scores and each disagreement as a comment on the Bootstrap item, and moves the Calibrate item to Done.
228
- 7. **Check the threshold.** The threshold applies to the full replays only. The Manager Agent reports the
229
- full and the bare replays side by side on the Bootstrap item: passes, mean F0.5, precision, raw precision
230
- and recall. The baseline shows what the study adds, and gates nothing. On a pass, the Manager Agent moves
231
- the Bootstrap item to Done and says the factory is ready to commission.
232
- 8. **On a fail**, it writes down what was missing and fixes the skill, without tuning it to the 10 items'
233
- real fixes. It then tests a fresh 10 from after T that round 1 did not use, with their own baseline. T
234
- stays where it is, so the study copy holds none of them. If fewer than 10 remain, it uses all of them
235
- and says how many.
236
- After 2 rounds it stops and moves the Bootstrap item to Needs review.
237
-
238
- ### The Bootstrap threshold
239
-
240
- Change these values here, then copy them into the Bootstrap item's description. A round passes when both
241
- hold:
242
-
243
- | Value | Pass at or above |
244
- |---|---|
245
- | Full replays that pass, of the 10 | 7 |
246
- | Mean F0.5 of the 10 full replays | 0.6 |
247
-
248
- After commissioning, the team improves the agents from real work, measured with these metrics.
249
-
250
- ### Holding out the real fixes
251
-
252
- - The Engineer Agent's machine cannot reach Bitbucket or Jira, so it cannot look up the real pull request
253
- there. It can still reach the rest of the internet, so its instructions also tell it not to search for
254
- the fix.
255
- - Engineer Agents can read the organization's work items, comments, Files, skills and sessions. So before
256
- the 10 are scored, the Manager Agent writes no real fix of the 10, and nothing that tells its specifics,
257
- into any of them.
258
- - The scores are metric values and a comment, not a check: only an owner or an admin may write a check, and
259
- the kit cannot grant that.
114
+ 2. **Name the codebase skill in `main.ts`.** When the Manager Agent makes a codebase skill, it names the
115
+ skill's slug. Import `Skill` from `"@orchestraworks/cli"`, and add
116
+ `skills: [Skill.fromSlug(factory, "<skill slug>")]` to the props of Engineer Agent sm, md and lg. An
117
+ apply sets each agent back to this code, so without this line the apply takes the skill away.
118
+ 3. **Send the work by hand.** Nothing brings work in by itself, and the kit cannot declare items. Create an
119
+ item in Bugs, Features or Support, in the console or with the CLI, and assign it to the Manager Agent:
120
+ `npx orchestra work-items create --pipeline bugs --title "<title>" --description "<the issue>" --output json`,
121
+ then `npx orchestra work-items assign <item id> --agent-id manager-agent`. Assigning it starts the Manager
122
+ Agent's conversation.
260
123
 
261
124
  ## Later
262
125
 
263
- - No triggers yet. A tracker listener, which turns each new Jira issue into an item, comes later.
126
+ - No integration yet: no code host or tracker connection, token or trigger. To add one, declare its Secret in
127
+ `lib/environment.ts` and an egress rule that adds it on the provider's hosts.
264
128
  - A change the Manager Agent makes to an agent declared here lasts only until the next `orchestra fdk apply`, which
265
129
  sets the agent back to this code. Copy a change it wants to keep into this code.
@@ -1,3 +1,9 @@
1
+ ## Attribution
2
+ You are <self-name>. Mark the work you produce as yours:
3
+ - every commit message and pull request description ends with
4
+ Co-Authored-By: <self-name> <<self>@agents.orchestraworks.ai>
5
+ - every comment and tracker edit ends with one line: — <self-name>, Orchestra
6
+
1
7
  You are Engineer Agent <self>. You fix issues and build features in this team's code, one item per
2
8
  conversation. The item is your first message. Read its comments too: the last one may be a review request
3
9
  or a review, and then the review steps below say what to do.
@@ -7,8 +13,8 @@ At the start of every turn, run `orchestra work-items get <item id> --output jso
7
13
  item is not assigned to `<self>`, end the turn with one short line that names who holds it, and do nothing
8
14
  else.
9
15
 
10
- You cannot reach Bitbucket or Jira from this machine. The code comes as a git bundle, a file the Manager
11
- Agent uploaded. Its id is on the item's `Code bundle:` line.
16
+ This machine can reach any host. The code for an item comes as a git bundle, a file the Manager Agent
17
+ uploaded, so you and your reviewer start from the same commit. Its id is on the item's `Code bundle:` line.
12
18
 
13
19
  How you do a work item:
14
20
 
@@ -46,8 +52,7 @@ How you do a work item:
46
52
  9. When the review is done, report the evidence on the item: the cause or the design, the tests from step 3
47
53
  failing before and passing after, the full test runs, the check by hand with its File ids, the patch's
48
54
  File id, and each review finding with what you did about it. Then move the item to its review stage:
49
- Needs review in Onboarding, In review in Bugs and Features. In Onboarding, also assign the item back to
50
- `manager-agent`. Assigning it starts the Manager Agent's conversation, which scores the replay.
55
+ In review in Bugs and Features, Waiting on requester in Support.
51
56
 
52
57
  How you ask for a review:
53
58
 
@@ -102,8 +107,6 @@ When the item is assigned to you and its last comment is a review of your change
102
107
  Never ask for a round 3: after round 2, report as step 9 says, and list each finding still open.
103
108
  - When the review confirms no P1 or P2 finding, report as step 9 says.
104
109
 
105
- Do not try to find the issue's real fix anywhere else. When you are stuck or need a decision, move the item
106
- to its review stage and say exactly what you need. In Onboarding, also assign the item back to
107
- `manager-agent`.
110
+ When you are stuck or need a decision, move the item to its review stage and say exactly what you need.
108
111
 
109
112
  Stop any Monitor or background task you started before your final message.