@awebai/oats 0.29.4 → 0.30.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/README.md +12 -6
- package/bin/oats.mjs +194 -50
- package/docs/capabilities.md +160 -171
- package/docs/capability-manifest.schema.json +6 -11
- package/docs/configuration.md +213 -64
- package/docs/design/2026-09-16-knowledge-capability-contract.md +36 -50
- package/docs/design/2026-09-23-workspace-module-contracts.md +377 -544
- package/docs/design/2026-09-26-okf-knowledge-operations.md +132 -357
- package/docs/design/2026-09-27-team-model-v2.md +97 -117
- package/docs/design/2026-09-28-automations-trust.md +38 -0
- package/docs/design/2026-09-28-soul-launch-preference.md +63 -0
- package/docs/design/HISTORY.md +65 -0
- package/docs/design/README.md +23 -54
- package/docs/desktop-cli-api.md +1787 -1777
- package/docs/desktop.md +30 -91
- package/docs/execution-targets.md +146 -292
- package/docs/first-team.md +31 -17
- package/docs/implementation.md +77 -288
- package/docs/integrations.md +118 -320
- package/docs/knowledge-capability-authoring.md +25 -52
- package/docs/knowledge-reference/acceptance.md +3 -3
- package/docs/knowledge-reference/adoption.md +1 -1
- package/docs/knowledge-reference/harvester.md +2 -2
- package/docs/knowledge-reference/package-craft.md +3 -3
- package/docs/knowledge-reference/provider-mapping.md +3 -6
- package/docs/knowledge-reference/reader-capture.md +3 -3
- package/docs/knowledge-theory.md +62 -166
- package/docs/knowledge.md +225 -404
- package/docs/layers.md +42 -97
- package/docs/oats-local.schema.json +58 -5
- package/docs/oats-membership.schema.json +1 -8
- package/docs/oats-package.schema.json +5 -5
- package/docs/oats-workspace.schema.json +8 -22
- package/docs/official-catalog.md +25 -28
- package/docs/packages.md +45 -63
- package/docs/plans/0.30-close-out.md +83 -0
- package/docs/release-lane.md +82 -0
- package/docs/release-notes/oats-framework-v1.1.3.md +10 -8
- package/docs/release-notes/v0.19.0.md +48 -147
- package/docs/release-notes/v0.19.1.md +2 -3
- package/docs/release-notes/v0.19.3.md +2 -15
- package/docs/release-notes/v0.20.0.md +0 -15
- package/docs/release-notes/v0.22.0.md +71 -138
- package/docs/release-notes/v0.22.1.md +42 -90
- package/docs/release-notes/v0.22.10.md +1 -1
- package/docs/release-notes/v0.22.11.md +1 -47
- package/docs/release-notes/v0.22.12.md +4 -13
- package/docs/release-notes/v0.22.13.md +1 -42
- package/docs/release-notes/v0.22.14.md +3 -11
- package/docs/release-notes/v0.22.15.md +1 -46
- package/docs/release-notes/v0.22.16.md +6 -8
- package/docs/release-notes/v0.22.18.md +1 -99
- package/docs/release-notes/v0.22.19.md +3 -14
- package/docs/release-notes/v0.22.2.md +6 -15
- package/docs/release-notes/v0.22.3.md +0 -1
- package/docs/release-notes/v0.22.4.md +1 -14
- package/docs/release-notes/v0.22.5.md +2 -12
- package/docs/release-notes/v0.22.6.md +0 -3
- package/docs/release-notes/v0.23.0.md +9 -25
- package/docs/release-notes/v0.23.1.md +9 -25
- package/docs/release-notes/v0.23.2.md +2 -4
- package/docs/release-notes/v0.24.0.md +56 -97
- package/docs/release-notes/v0.24.1.md +7 -11
- package/docs/release-notes/v0.24.10.md +34 -45
- package/docs/release-notes/v0.24.11.md +12 -20
- package/docs/release-notes/v0.24.12.md +35 -48
- package/docs/release-notes/v0.24.13.md +34 -41
- package/docs/release-notes/v0.24.2.md +9 -13
- package/docs/release-notes/v0.24.3.md +7 -11
- package/docs/release-notes/v0.24.4.md +6 -6
- package/docs/release-notes/v0.24.5.md +6 -10
- package/docs/release-notes/v0.24.6.md +2 -5
- package/docs/release-notes/v0.24.7.md +46 -75
- package/docs/release-notes/v0.24.8.md +58 -96
- package/docs/release-notes/v0.24.9.md +38 -54
- package/docs/release-notes/v0.25.0.md +59 -76
- package/docs/release-notes/v0.25.1.md +57 -81
- package/docs/release-notes/v0.25.2.md +51 -70
- package/docs/release-notes/v0.25.3.md +11 -13
- package/docs/release-notes/v0.25.4.md +9 -13
- package/docs/release-notes/v0.25.5.md +3 -5
- package/docs/release-notes/v0.25.6.md +20 -29
- package/docs/release-notes/v0.25.7.md +5 -7
- package/docs/release-notes/v0.25.8.md +26 -39
- package/docs/release-notes/v0.26.0.md +175 -646
- package/docs/release-notes/v0.27.0.md +4 -5
- package/docs/release-notes/v0.27.1.md +4 -6
- package/docs/release-notes/v0.27.2.md +1 -1
- package/docs/release-notes/v0.28.0.md +57 -124
- package/docs/release-notes/v0.29.0.md +89 -208
- package/docs/release-notes/v0.29.1.md +1 -1
- package/docs/release-notes/v0.29.2.md +3 -4
- package/docs/release-notes/v0.30.0.md +205 -0
- package/docs/release-notes/v0.30.1.md +123 -0
- package/docs/schedules.md +280 -363
- package/docs/servers.md +99 -117
- package/docs/soul.schema.json +2 -9
- package/docs/souls-and-instances.md +145 -158
- package/docs/workspaces.md +137 -215
- package/lib/automations.mjs +21 -6
- package/lib/core.mjs +226 -74
- package/lib/instance-events.mjs +1 -1
- package/lib/instance-inspect.mjs +109 -34
- package/lib/instance-lifecycle.mjs +14 -1
- package/lib/instance-resolution.mjs +26 -27
- package/lib/launch-preference.mjs +87 -0
- package/lib/materialize.mjs +3 -3
- package/lib/packages.mjs +1 -1
- package/lib/resolve.mjs +30 -88
- package/lib/schedule.mjs +1 -1
- package/lib/teams-verbs.mjs +195 -0
- package/lib/teams.mjs +190 -0
- package/lib/triggers.mjs +2 -2
- package/lib/workspace.mjs +54 -147
- package/package-catalog.json +10 -16
- package/package.json +1 -3
- package/skills/oats-getting-started/SKILL.md +25 -13
- package/capabilities/oats-authoring/LICENSE +0 -21
- package/capabilities/oats-authoring/oats-package.json +0 -11
- package/capabilities/oats-authoring/oats.json +0 -12
- package/capabilities/oats-authoring/skills/integration-authoring/SKILL.md +0 -84
- package/capabilities/oats-authoring/skills/skill-craft/SKILL.md +0 -109
- package/capabilities/oats-authoring/skills/soul-craft/SKILL.md +0 -116
- package/capabilities/oats-aweb/bin/oats-aweb-binding.mjs +0 -11
- package/capabilities/oats-aweb/bin/oats-aweb.mjs +0 -1338
- package/capabilities/oats-aweb/injects/aweb.md +0 -47
- package/capabilities/oats-aweb/lib/binding-wire.mjs +0 -356
- package/capabilities/oats-aweb/lib/captured-execution.mjs +0 -91
- package/capabilities/oats-aweb/lib/captured-native.mjs +0 -91
- package/capabilities/oats-aweb/lib/grant-custody.mjs +0 -38
- package/capabilities/oats-aweb/lib/invocation-shape.mjs +0 -135
- package/capabilities/oats-aweb/lib/portable-binding.mjs +0 -146
- package/capabilities/oats-aweb/lib/session-readiness.mjs +0 -56
- package/capabilities/oats-aweb/lib/wake-receive.mjs +0 -56
- package/capabilities/oats-aweb/oats.json +0 -208
- package/capabilities/oats-aweb/skills/LICENSE +0 -21
- package/capabilities/oats-aweb/skills/VENDORED.md +0 -31
- package/capabilities/oats-aweb/skills/aweb-identity/SKILL.md +0 -201
- package/capabilities/oats-aweb/skills/aweb-messaging/SKILL.md +0 -161
- package/capabilities/oats-aweb/skills/aweb-messaging/references/messaging-scenarios.md +0 -61
- package/capabilities/oats-aweb/skills/aweb-team-membership/SKILL.md +0 -116
- package/capabilities/oats-aweb/skills/aweb-team-membership/references/team-membership-reference.md +0 -74
- package/capabilities/oats-aweb/skills/oats-aweb/SKILL.md +0 -216
- package/capabilities/oats-jira/bin/oats-jira.mjs +0 -40
- package/capabilities/oats-jira/injects/jira.md +0 -10
- package/capabilities/oats-jira/oats.json +0 -22
- package/capabilities/oats-jira/skills/jira-tasks/SKILL.md +0 -179
- package/capabilities/oats-linear/bin/oats-linear-hook.mjs +0 -34
- package/capabilities/oats-linear/bin/oats-linear.mjs +0 -344
- package/capabilities/oats-linear/injects/linear.md +0 -8
- package/capabilities/oats-linear/oats.json +0 -24
- package/capabilities/oats-linear/skills/linear-tasks/SKILL.md +0 -223
- package/capabilities/oats-okf/bin/oats-okf-binding.mjs +0 -14
- package/capabilities/oats-okf/bin/oats-okf.mjs +0 -209
- package/capabilities/oats-okf/injects/okf.md +0 -42
- package/capabilities/oats-okf/lib/binding-wire.mjs +0 -348
- package/capabilities/oats-okf/lib/captured-worker.mjs +0 -109
- package/capabilities/oats-okf/lib/config.mjs +0 -124
- package/capabilities/oats-okf/lib/consult.mjs +0 -518
- package/capabilities/oats-okf/lib/harvest-status.mjs +0 -88
- package/capabilities/oats-okf/lib/harvest-switch.mjs +0 -94
- package/capabilities/oats-okf/lib/inspection.mjs +0 -119
- package/capabilities/oats-okf/lib/invocation-context.mjs +0 -111
- package/capabilities/oats-okf/lib/invocation-shape.mjs +0 -135
- package/capabilities/oats-okf/lib/io.mjs +0 -118
- package/capabilities/oats-okf/lib/migration.mjs +0 -137
- package/capabilities/oats-okf/lib/okf-validate.mjs +0 -123
- package/capabilities/oats-okf/lib/portable-binding.mjs +0 -199
- package/capabilities/oats-okf/lib/source-contract.mjs +0 -46
- package/capabilities/oats-okf/lib/sources.mjs +0 -424
- package/capabilities/oats-okf/lib/stores.mjs +0 -473
- package/capabilities/oats-okf/lib/worker.mjs +0 -497
- package/capabilities/oats-okf/oats.json +0 -148
- package/capabilities/oats-okf/schemas/okf-base.schema.json +0 -46
- package/capabilities/oats-okf/schemas/okf-bindings.schema.json +0 -112
- package/capabilities/oats-okf/schemas/okf-portable-declaration.schema.json +0 -87
- package/capabilities/oats-okf/schemas/okf-portable-payload.schema.json +0 -113
- package/capabilities/oats-okf/schemas/okf-soul.schema.json +0 -37
- package/capabilities/oats-okf/skills/okf-consultation/SKILL.md +0 -144
- package/capabilities/oats-okf/skills/okf-consultation/references/consult.md +0 -86
- package/capabilities/oats-okf/skills/okf-instance-knowledge/SKILL.md +0 -104
- package/capabilities/oats-okf-harvest/bin/okf-harvest.mjs +0 -140
- package/capabilities/oats-okf-harvest/injects/harvester.md +0 -12
- package/capabilities/oats-okf-harvest/oats.json +0 -26
- package/capabilities/oats-okf-harvest/skills/knowledge-harvest/SKILL.md +0 -168
- package/capabilities/oats-okf-harvest/skills/knowledge-theory/SKILL.md +0 -192
- package/capabilities/oats-okf-harvest/skills/okf-authoring/SKILL.md +0 -151
- package/capabilities/oats-okf-harvest/skills/okf-authoring/scripts/okf-validate.mjs +0 -123
- package/capabilities/oats-okf-maintenance/bin/okf-maintenance.mjs +0 -170
- package/capabilities/oats-okf-maintenance/injects/maintainer.md +0 -12
- package/capabilities/oats-okf-maintenance/lib/provenance.mjs +0 -50
- package/capabilities/oats-okf-maintenance/oats.json +0 -21
- package/capabilities/oats-okf-maintenance/skills/knowledge-review/SKILL.md +0 -159
- package/capabilities/oats-okf-maintenance/skills/knowledge-theory/SKILL.md +0 -192
- package/capabilities/oats-okf-maintenance/skills/okf-authoring/SKILL.md +0 -151
- package/capabilities/oats-okf-maintenance/skills/okf-authoring/scripts/okf-validate.mjs +0 -123
- package/capabilities/oats-okf-maintenance/skills/okf-trigger-setup/SKILL.md +0 -146
- package/capabilities/oats-review/injects/review.md +0 -69
- package/capabilities/oats-review/oats.json +0 -10
- package/capabilities/oats-review/skills/code-review/SKILL.md +0 -44
- package/capabilities/oats-review/skills/security-review/SKILL.md +0 -59
- package/docs/conventions.md +0 -90
- package/docs/design/2026-09-07-architecture-reassessment.md +0 -131
- package/docs/design/2026-09-07-desktop-souls-capabilities.md +0 -50
- package/docs/design/2026-09-07-mobile-agent-management-proposal.md +0 -228
- package/docs/design/2026-09-08-expert-assisted-deployment-proposal.md +0 -558
- package/docs/design/2026-09-13-knowledge-and-memory-direction.md +0 -744
- package/docs/design/2026-09-13-knowledge-implementation.md +0 -127
- package/docs/design/2026-09-13-knowledge-location-contract.md +0 -340
- package/docs/design/2026-09-14-artifact-retention-contract.md +0 -190
- package/docs/design/2026-09-14-portable-souls-and-git-workspaces.md +0 -708
- package/docs/design/2026-09-14-portable-souls-contract-amendments.md +0 -85
- package/docs/design/2026-09-14-portable-souls-explainer.md +0 -750
- package/docs/design/2026-09-15-captured-dispatch.md +0 -127
- package/docs/design/2026-09-15-captured-resolution-records.md +0 -143
- package/docs/design/2026-09-15-package-preparation.md +0 -100
- package/docs/design/2026-09-15-portable-data-contract.md +0 -121
- package/docs/design/2026-09-15-portable-declarations.md +0 -189
- package/docs/design/2026-09-15-portable-souls-handoff.md +0 -150
- package/docs/design/2026-09-15-portable-souls-implementation.md +0 -417
- package/docs/design/2026-09-15-selection-lock-and-approval.md +0 -122
- package/docs/design/2026-09-15-source-observation.md +0 -119
- package/docs/design/2026-09-16-captured-admission.md +0 -77
- package/docs/design/2026-09-16-captured-helper-dispatch.md +0 -105
- package/docs/design/2026-09-16-captured-launch-inputs.md +0 -42
- package/docs/design/2026-09-16-command-profile-preparation.md +0 -86
- package/docs/design/2026-09-16-fresh-install-first-rollout.md +0 -47
- package/docs/design/2026-09-16-fresh-operator-walkthrough.md +0 -282
- package/docs/design/2026-09-16-messaging-capability-contract.md +0 -59
- package/docs/design/2026-09-16-portable-migration-evidence.md +0 -158
- package/docs/design/2026-09-16-portable-onboarding.md +0 -179
- package/docs/design/2026-09-16-prepare-request-transport.md +0 -26
- package/docs/design/2026-09-16-provider-binding-codecs.md +0 -98
- package/docs/design/2026-09-16-provider-binding-wire.md +0 -274
- package/docs/design/2026-09-17-capability-helper-input-contract.md +0 -95
- package/docs/design/2026-09-17-captured-backend-parity.md +0 -53
- package/docs/design/2026-09-17-captured-native-start.md +0 -58
- package/docs/design/2026-09-17-portable-boundary-hookup.md +0 -19
- package/docs/design/2026-09-17-portable-boundary-resources.md +0 -52
- package/docs/design/2026-09-17-public-captured-start.md +0 -108
- package/docs/design/2026-09-17-public-prepare-request.md +0 -90
- package/docs/design/2026-09-18-captured-pi-host.md +0 -205
- package/docs/design/2026-09-18-first-cut-release-checklist.md +0 -131
- package/docs/design/2026-09-18-herdr-protocol-compatibility.md +0 -60
- package/docs/design/2026-09-20-redesign-program-board.md +0 -142
- package/docs/design/2026-09-20-workspace-and-portable-adoption-plan.md +0 -289
- package/docs/design/2026-09-20-workspace-onboarding-public.md +0 -207
- package/docs/design/2026-09-22-desktop-parity-seams.md +0 -58
- package/docs/design/2026-09-23-simplified-workspace-model.md +0 -711
- package/docs/design/2026-09-23-workspace-v2-implementation-plan.md +0 -65
- package/docs/design/2026-09-24-desktop-phase-f-boundary.md +0 -242
- package/docs/design/2026-09-24-phase-d-plan.md +0 -305
- package/docs/design/2026-09-25-teams-contract.md +0 -258
- package/docs/design/2026-09-26-desktop-design-brief-architecture.md +0 -241
- package/docs/design/desktop-ux-plan.md +0 -362
- package/docs/design/launch-configurations.md +0 -168
- package/docs/design/okf-mirror-provenance.md +0 -105
- package/docs/design/operations-contract.md +0 -141
- package/docs/oats-member.schema.json +0 -38
- package/skills/integration-authoring/SKILL.md +0 -84
- package/skills/oats-support/SKILL.md +0 -79
- package/skills/skill-craft/SKILL.md +0 -109
- package/skills/soul-craft/SKILL.md +0 -116
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: linear-tasks
|
|
3
|
-
description: >-
|
|
4
|
-
Linear task tracking for OATS agent instances. Use when reading an agent's
|
|
5
|
-
Linear work queue, opening or inspecting an issue, creating issues or
|
|
6
|
-
sub-issues, claiming work with an agent label, posting progress/blocker/
|
|
7
|
-
handoff comments, or moving work through Linear workflow states. Also use
|
|
8
|
-
when asked about "my issue", "the project", "the board", a Linear issue key
|
|
9
|
-
such as ENG-123, or shared task status. Uses JSON-first `oats linear` commands.
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
# Agent task tracking in Linear
|
|
13
|
-
|
|
14
|
-
Linear is your deployment's **tasks layer**: task status and outcomes live
|
|
15
|
-
here. Conversation lives in the messaging layer; a message may nudge someone,
|
|
16
|
-
but it never replaces the Linear update.
|
|
17
|
-
|
|
18
|
-
## Deployment target and authentication
|
|
19
|
-
|
|
20
|
-
Get the target from the `Tasks: Linear` line in your `TASK.md` briefing:
|
|
21
|
-
|
|
22
|
-
- **team** is required and uses Linear's issue-prefix key (for example `ENG`).
|
|
23
|
-
- **project** is an optional deployment default. Do not invent one when unset.
|
|
24
|
-
- **alias** is your exact OATS instance name; your label is `agent-<alias>`.
|
|
25
|
-
|
|
26
|
-
team and project come from the tasks payload OATS merged for this instance —
|
|
27
|
-
the soul's `soul.yaml` `tasks: { team, project }`, the deployment's
|
|
28
|
-
`oats-local.yaml` `settings.oats.linear.*`, or a spawn's `--provider` — and
|
|
29
|
-
`./instance.json` in your instance home records it as `providers["oats.linear"]`.
|
|
30
|
-
If team is unset, stop and ask your human to set it there.
|
|
31
|
-
|
|
32
|
-
Before the first operation, run:
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
oats linear auth
|
|
36
|
-
oats linear teams
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
If `LINEAR_API_KEY` is missing or rejected, **stop and ask the human** to create
|
|
40
|
-
or export a personal API key (Linear Settings → Security & access → API keys).
|
|
41
|
-
Never ask for the key's value, print it, put it in a command argument, or store
|
|
42
|
-
it in OATS config/files. Never attempt an interactive login.
|
|
43
|
-
|
|
44
|
-
Commands emit JSON. An error is JSON on stderr with a non-zero exit code; act
|
|
45
|
-
on that error rather than retrying variants blindly.
|
|
46
|
-
|
|
47
|
-
## Hierarchy
|
|
48
|
-
|
|
49
|
-
- **Project** — an optional, human-owned outcome or initiative container. Do
|
|
50
|
-
not create, rename, change status, or close projects.
|
|
51
|
-
- **Issue** — the normal bounded work item assigned to an agent.
|
|
52
|
-
- **Sub-issue** — an issue with a parent, used only when the parent genuinely
|
|
53
|
-
decomposes into multiple independently verifiable pieces.
|
|
54
|
-
|
|
55
|
-
Do not create placeholder parent issues for one child. Every issue belongs to
|
|
56
|
-
a team; project membership is optional unless your briefing names a project.
|
|
57
|
-
|
|
58
|
-
## Project context and documentation
|
|
59
|
-
|
|
60
|
-
Use project-level and issue-level records deliberately:
|
|
61
|
-
|
|
62
|
-
- **Project overview**: intent, scope/non-goals, ownership, constraints, human
|
|
63
|
-
gates, architecture, and success criteria.
|
|
64
|
-
- **Project documents**: detailed designs, decisions, runbooks, and research.
|
|
65
|
-
- **Issues/sub-issues**: bounded execution and acceptance criteria.
|
|
66
|
-
- **Issue comments**: milestones, blockers, handoffs, verification, and links.
|
|
67
|
-
|
|
68
|
-
The overview/documents explain the work; issues execute it. Link a governing
|
|
69
|
-
project document from each affected issue rather than copying inconsistent
|
|
70
|
-
versions. Keep task status in issues, not project prose or messaging.
|
|
71
|
-
|
|
72
|
-
The current wrapper can discover project metadata but **cannot read or mutate
|
|
73
|
-
project overview Markdown or Linear documents**:
|
|
74
|
-
|
|
75
|
-
```bash
|
|
76
|
-
oats linear projects --team <TEAM>
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
That output includes project IDs, names, slugs, status, and teams. Project
|
|
80
|
-
creation, lifecycle/status, overview content, documents, and project updates
|
|
81
|
-
remain human-owned in the Linear UI. If your task depends on unavailable
|
|
82
|
-
project documentation, ask the human for its URL/content; never infer policy
|
|
83
|
-
from an issue title.
|
|
84
|
-
|
|
85
|
-
## Identity and ownership
|
|
86
|
-
|
|
87
|
-
- Keep the **human assignee unchanged**. A personal API key acts as its human;
|
|
88
|
-
OATS agents are not Linear users.
|
|
89
|
-
- Claim work with label `agent-<exact-instance-name>`. `--agent <alias>` creates
|
|
90
|
-
this team-scoped label on first use and applies it.
|
|
91
|
-
- New issue descriptions also receive `Agent: <alias>`. On existing issues,
|
|
92
|
-
use the label and comments; do not rewrite a human's description merely to
|
|
93
|
-
add the line.
|
|
94
|
-
- Never delete issues, labels, or comments. Do not change cycle, priority,
|
|
95
|
-
project, parent, or assignee unless explicitly directed.
|
|
96
|
-
|
|
97
|
-
## Read before writing
|
|
98
|
-
|
|
99
|
-
```bash
|
|
100
|
-
# Your open queue (terminal states excluded by default)
|
|
101
|
-
oats linear issue list --team <TEAM> --agent <alias>
|
|
102
|
-
|
|
103
|
-
# Narrow to the deployment project when one is configured
|
|
104
|
-
oats linear issue list --team <TEAM> --agent <alias> --project "<PROJECT>"
|
|
105
|
-
|
|
106
|
-
# Read full task context before acting
|
|
107
|
-
oats linear issue get <TEAM>-123
|
|
108
|
-
|
|
109
|
-
# Discover this team's real workflow names; never guess them
|
|
110
|
-
oats linear states --team <TEAM>
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
`issue get` includes team, status/type, project, parent, assignee, labels,
|
|
114
|
-
description, and URL. Read the parent too when working a sub-issue. Record the
|
|
115
|
-
issue key in instance memory (`STATE.md`) if your knowledge layer provides it.
|
|
116
|
-
|
|
117
|
-
## Work an issue
|
|
118
|
-
|
|
119
|
-
1. Read the issue and parent/project context.
|
|
120
|
-
2. If not already claimed, apply your identity label:
|
|
121
|
-
|
|
122
|
-
```bash
|
|
123
|
-
oats linear issue update <TEAM>-123 --agent <alias>
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
3. Move to the deployment's `started` workflow state (often `In Progress`),
|
|
127
|
-
using the exact name returned by `oats linear states`:
|
|
128
|
-
|
|
129
|
-
```bash
|
|
130
|
-
oats linear issue update <TEAM>-123 --state "In Progress"
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
4. Post only useful durable events, prefixed with your alias:
|
|
134
|
-
|
|
135
|
-
```bash
|
|
136
|
-
oats linear issue comment <TEAM>-123 \
|
|
137
|
-
--body "[<alias>] milestone: implemented parser; tests pass with node --test"
|
|
138
|
-
oats linear issue comment <TEAM>-123 \
|
|
139
|
-
--body "[<alias>] blocked: need API scope decision from @owner"
|
|
140
|
-
oats linear issue comment <TEAM>-123 \
|
|
141
|
-
--body "[<alias>] handoff → <next-alias>: branch agents/x, verify with npm test"
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
5. When implementation is review-ready, comment the outcome (branch/PR and
|
|
145
|
-
verification), then move to the team's review state. Do **not** mark it
|
|
146
|
-
completed:
|
|
147
|
-
|
|
148
|
-
```bash
|
|
149
|
-
oats linear issue comment <TEAM>-123 \
|
|
150
|
-
--body "[<alias>] review-ready: PR <url>; verified npm test"
|
|
151
|
-
oats linear issue update <TEAM>-123 --state "In Review"
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
Workflow names vary. Agents may use backlog/unstarted/started states. The
|
|
155
|
-
wrapper refuses `completed`, `canceled`, and `duplicate` state types unless
|
|
156
|
-
`--allow-terminal` is supplied; use that override only after explicit human
|
|
157
|
-
authorization and mention that authorization in a comment.
|
|
158
|
-
|
|
159
|
-
## Create bounded work
|
|
160
|
-
|
|
161
|
-
Use ≤12 words in the title. Describe requirements and acceptance checks, not a
|
|
162
|
-
speculative implementation. For multiline Markdown, prefer a file so shell
|
|
163
|
-
quoting cannot corrupt it.
|
|
164
|
-
|
|
165
|
-
```bash
|
|
166
|
-
cat > /tmp/linear-description.md <<'EOF'
|
|
167
|
-
Why this is needed.
|
|
168
|
-
|
|
169
|
-
Acceptance:
|
|
170
|
-
- [ ] Observable outcome one
|
|
171
|
-
- [ ] Verification command or evidence
|
|
172
|
-
EOF
|
|
173
|
-
|
|
174
|
-
oats linear issue create --team <TEAM> --project "<PROJECT>" \
|
|
175
|
-
--title "Bounded outcome" --description-file /tmp/linear-description.md \
|
|
176
|
-
--agent <alias>
|
|
177
|
-
```
|
|
178
|
-
|
|
179
|
-
Omit `--project` when the briefing has none. Create a sub-issue only for a real
|
|
180
|
-
independent slice:
|
|
181
|
-
|
|
182
|
-
```bash
|
|
183
|
-
oats linear issue create --team <TEAM> --parent <TEAM>-123 \
|
|
184
|
-
--title "Independent child outcome" \
|
|
185
|
-
--description-file /tmp/linear-description.md --agent <alias>
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
`--project` sets project membership; `--parent` sets issue hierarchy. They are
|
|
189
|
-
independent, so supply both when a sub-issue must explicitly carry the project:
|
|
190
|
-
|
|
191
|
-
```bash
|
|
192
|
-
oats linear issue create --team <TEAM> --project "<PROJECT>" \
|
|
193
|
-
--parent <TEAM>-123 --title "Independent child outcome" \
|
|
194
|
-
--description-file /tmp/linear-description.md --agent <alias>
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
Use an existing non-agent label only after discovery:
|
|
198
|
-
|
|
199
|
-
```bash
|
|
200
|
-
oats linear labels --team <TEAM>
|
|
201
|
-
oats linear issue create --team <TEAM> --title "Fix token refresh" \
|
|
202
|
-
--label bug --agent <alias>
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
## Current command boundary
|
|
206
|
-
|
|
207
|
-
Supported: discover teams/states/projects/labels; list/get/create/update/comment
|
|
208
|
-
on issues; create sub-issues; claim work with agent labels.
|
|
209
|
-
|
|
210
|
-
Not supported: create/update/close projects; read/edit project overviews;
|
|
211
|
-
list/read/create/edit project documents; publish project updates; move an
|
|
212
|
-
existing issue into/out of a project; reparent an existing issue; or create
|
|
213
|
-
issue relations such as blocks/related. Those operations stay in the Linear
|
|
214
|
-
UI with the human. **Do not invent GraphQL calls or command flags to bypass
|
|
215
|
-
this boundary.**
|
|
216
|
-
|
|
217
|
-
## Validate every mutation
|
|
218
|
-
|
|
219
|
-
Mutation output is the resulting issue/comment. Check its identifier, status,
|
|
220
|
-
project/parent, and labels immediately. Then run `issue get` for
|
|
221
|
-
correctness-critical changes. If a GraphQL permission or validation error
|
|
222
|
-
persists, post no partial workaround: preserve the task state and escalate to
|
|
223
|
-
the human with the exact error (never the key).
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { runBindingWire } from '../lib/binding-wire.mjs';
|
|
3
|
-
|
|
4
|
-
const args=process.argv.slice(2);
|
|
5
|
-
if(args.includes('--help') || args.includes('-h')) {
|
|
6
|
-
process.stdout.write('oats okf provider binding phase (manifest-owned JSON stdin/stdout)\n');
|
|
7
|
-
} else {
|
|
8
|
-
const phase=args[0];
|
|
9
|
-
if(args.length!==1) {
|
|
10
|
-
await runBindingWire(phase,[],process.stdout);
|
|
11
|
-
} else {
|
|
12
|
-
await runBindingWire(phase);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
@@ -1,209 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { fs, join, resolve, readJSON, safePath, oats, fail, unlock, redactUrls } from '../lib/io.mjs';
|
|
3
|
-
import { loadBindings } from '../lib/config.mjs';
|
|
4
|
-
import { register, registerCaptured, loadInvocationSourceReceipt, homeSource, loadSource, loadStatus, saveStatus, updateStatus, capture, scheduleSource, settleRetiredSchedule, service, markerPath, harvestOffRecord, sourceSwitch, retireHarvestOff } from '../lib/sources.mjs';
|
|
5
|
-
import { harvestStatus, setupHarvest } from '../lib/harvest-status.mjs';
|
|
6
|
-
import { settings } from '../lib/config.mjs';
|
|
7
|
-
import { CONSULT } from '../lib/consult.mjs';
|
|
8
|
-
import { runSource, complete, retry, readRun, requireQualifiedHelper } from '../lib/worker.mjs';
|
|
9
|
-
import { initBase, migrate, deliverMigration, cutoverMigration, migrateSource, forgetMigration } from '../lib/migration.mjs';
|
|
10
|
-
import { inspect } from '../lib/inspection.mjs';
|
|
11
|
-
import { loadInvocationKnowledgeBinding } from '../lib/binding-wire.mjs';
|
|
12
|
-
import { loadCapturedOkfInvocation, loadOkfSourceReceiptInput, assertOkfInvocationAction, requireOkfAdmittedAction, assertOkfSourceContext, assertOkfRegisteredSourceReplay } from '../lib/invocation-context.mjs';
|
|
13
|
-
const HELP=`oats okf inspect [--home PATH | --source FILE] [--json]
|
|
14
|
-
oats okf harvest [--home PATH] [--no-launch] [--json]
|
|
15
|
-
oats okf run-source --source FILE [--manual] [--no-launch] [--json]
|
|
16
|
-
oats okf complete --source FILE --run ID --judgment FILE [--json]
|
|
17
|
-
oats okf retry --source FILE [--run ID --rejudge | --rejudge | --launch | --adopt-home PATH] [--json]
|
|
18
|
-
oats okf bases [--fresh] [--json]
|
|
19
|
-
oats okf index [--base ALIAS] [NODE | ALIAS/NODE] [--fresh] [--json]
|
|
20
|
-
oats okf cat --base ALIAS PATH [--from PATH] [--fresh] [--json]
|
|
21
|
-
oats okf ls --base ALIAS [DIR] [--fresh] [--json]
|
|
22
|
-
oats okf links --base ALIAS PATH [--fresh] [--json]
|
|
23
|
-
oats okf search [--base ALIAS | --all] [--node NODE] [--regex] [--case-sensitive] TEXT [--fresh] [--json]
|
|
24
|
-
Consult commands read the accepted state remotely (host cache, no local copy);
|
|
25
|
-
also accept --home PATH | --source FILE. PATH is /node/x.md from the base root,
|
|
26
|
-
relative to --from's directory, or bare node/x.md from the root.
|
|
27
|
-
oats okf setup --source FILE [--enable | --disable] [--install-host] [--json]
|
|
28
|
-
oats okf setup --harvest on|off [--json] (writes oats-local.yaml settings.oats.okf.harvest)
|
|
29
|
-
oats okf harvest-status [--soul NAME] [--json] (the effective harvest switch, why, and the registered sources)
|
|
30
|
-
oats okf init --base ALIAS --nodes FILE [--output PATH | --confirm] [--json]
|
|
31
|
-
oats okf migrate --legacy PATH --base ALIAS --node NODE --output PATH [--json]
|
|
32
|
-
oats okf migrate --deliver FILE | --cutover FILE --soul-dir PATH [--json]
|
|
33
|
-
oats okf migrate --source-home PATH [--json]
|
|
34
|
-
oats okf migrate --forget ID [--json]
|
|
35
|
-
oats okf unlock --lock PATH --token TOKEN [--json]
|
|
36
|
-
Captured workers use oats operation run knowledge:harvest with SOURCE --deployment/--resolution/--home,
|
|
37
|
-
--arg native-request=ABS_BACKEND_ONLY_JSON and optional --arg worker-mode=prepare|launch.
|
|
38
|
-
Raw captured harvest/run-source/scheduler/rejudge remain held; completed runs use SOURCE complete/retry.
|
|
39
|
-
Unknown scaffold/native outcomes are retained, never automatically re-scaffolded or redispatched.
|
|
40
|
-
Explicit retry --run ID requires --rejudge; add --launch only for operator-approved launch.
|
|
41
|
-
Closed-PR recovery uses retained evidence and a fresh run; complete its returned ID.
|
|
42
|
-
Settled destinations and old proposals/receipts are preserved; another active run blocks recovery.
|
|
43
|
-
All settings use one absolute bindings-file. Setup host installation is explicit.
|
|
44
|
-
`;
|
|
45
|
-
const args=process.argv.slice(2);
|
|
46
|
-
if(args.includes('--help') || args.includes('-h')) {process.stdout.write(HELP);}
|
|
47
|
-
else {
|
|
48
|
-
const event=process.env.OATS_EVENT || args[0];
|
|
49
|
-
const hook=['spawn','retire','soul-scaffold'].includes(event);
|
|
50
|
-
const consult=Object.hasOwn(CONSULT,event);
|
|
51
|
-
let exit=0,answer,text,textMode=consult && !args.includes('--json');
|
|
52
|
-
try {
|
|
53
|
-
const flags={},positionals=[]; const boolean=new Set(['json','no-launch','manual','rejudge','launch','enable','disable','install-host','confirm','fresh','all','regex','case-sensitive']);
|
|
54
|
-
for(let i=1;i<args.length;i++) {
|
|
55
|
-
if(consult && args[i]==='--') {positionals.push(...args.slice(i+1));break;}
|
|
56
|
-
if(!args[i].startsWith('--')) {if(!consult) fail('E_USAGE',`unexpected argument ${args[i]}`);positionals.push(args[i]);continue;}
|
|
57
|
-
const k=args[i].slice(2);if(k in flags) fail('E_USAGE',`duplicate --${k}`);
|
|
58
|
-
if(boolean.has(k)) flags[k]=true;
|
|
59
|
-
else {if(!args[i+1] || args[i+1].startsWith('--')) fail('E_USAGE',`--${k} needs a value`);flags[k]=args[++i];}
|
|
60
|
-
}
|
|
61
|
-
const accepted={
|
|
62
|
-
spawn:[],retire:['home'], 'soul-scaffold':[],
|
|
63
|
-
harvest:['home','no-launch','native-request','worker-mode'],inspect:['home','source'],
|
|
64
|
-
'run-source':['source','manual','no-launch'],complete:['source','run','judgment'],
|
|
65
|
-
retry:['source','run','rejudge','launch','adopt-home'],read:['home','source','base','path','fresh'],refresh:['home','source'],'harvest-status':['home'],
|
|
66
|
-
bases:['home','source','fresh'],index:['home','source','base','fresh'],cat:['home','source','base','from','fresh'],ls:['home','source','base','fresh'],
|
|
67
|
-
links:['home','source','base','fresh'],search:['home','source','base','all','node','regex','case-sensitive','fresh'],
|
|
68
|
-
setup:['source','enable','disable','install-host','harvest'],init:['base','nodes','output','confirm'],
|
|
69
|
-
migrate:['source-home','legacy','base','node','output','deliver','cutover','soul-dir'],unlock:['lock','token']
|
|
70
|
-
};
|
|
71
|
-
for(const k of Object.keys(flags)) if(!['json','soul',...(accepted[event] || [])].includes(k)) fail('E_USAGE',`unknown flag --${k} for ${event}`);
|
|
72
|
-
if(flags.source && flags.home) fail('E_USAGE','choose source descriptor OR home');
|
|
73
|
-
const execution=Object.hasOwn(process.env,'OATS_INVOCATION_CONTEXT_FILE')?loadCapturedOkfInvocation():null;
|
|
74
|
-
const invocation=execution?{kind:'captured',binding:execution.binding}:loadInvocationKnowledgeBinding(),captured=invocation.kind==='captured';
|
|
75
|
-
if(execution) assertOkfInvocationAction(execution.context,event,readJSON(new URL('../oats.json',import.meta.url)));
|
|
76
|
-
// Only an actual admitted, instance-scoped kernel operation can create a
|
|
77
|
-
// captured worker. Raw commands/null intents and legacy ingress stay closed.
|
|
78
|
-
const capturedHarvest=captured && execution?.context.action.kind==='operation' && execution.context.action.slot==='knowledge' && execution.context.action.name==='harvest';
|
|
79
|
-
if(captured && event==='harvest') {
|
|
80
|
-
if(!capturedHarvest)requireQualifiedHelper({providerBinding:invocation.binding});
|
|
81
|
-
requireOkfAdmittedAction(execution.context);
|
|
82
|
-
if(!flags['native-request']||!['prepare','launch'].includes(flags['worker-mode']||'launch'))fail('E_CAPTURED_HELPER','captured harvest needs explicit native-request and supported worker-mode');
|
|
83
|
-
}
|
|
84
|
-
const unsupportedCaptured=new Set(['setup','init','migrate','unlock']);
|
|
85
|
-
if(captured && unsupportedCaptured.has(event)) fail('E_MIGRATION',`captured ${event} is not supported; use an explicit operator administration path`);
|
|
86
|
-
const target=execution?.context.instance;
|
|
87
|
-
if(target && flags.home && resolve(flags.home)!==target.home) fail('E_INVOCATION','captured invocation target differs from requested home');
|
|
88
|
-
const home=target?.home || resolve(flags.home || (execution?process.cwd():process.env.OATS_INSTANCE_HOME || process.env.OATS_HOME || process.cwd()));
|
|
89
|
-
if(execution && ['spawn','retire'].includes(event)) requireOkfAdmittedAction(execution.context);
|
|
90
|
-
const sourceReceipt=execution?loadOkfSourceReceiptInput(execution):loadInvocationSourceReceipt(home);
|
|
91
|
-
if(sourceReceipt.mode==='captured' && !['spawn','retire'].includes(event)) fail('E_SOURCE','captured source receipt is valid only for lifecycle hooks');
|
|
92
|
-
const src=()=>{
|
|
93
|
-
try {
|
|
94
|
-
const source=flags.source?loadSource(resolve(flags.source)):homeSource(home);
|
|
95
|
-
if(execution) assertOkfSourceContext(source,execution.context,execution.binding);
|
|
96
|
-
else if(captured) assertOkfRegisteredSourceReplay(source,invocation.binding);
|
|
97
|
-
else if(source.providerBinding && event!=='inspect') fail('E_INVOCATION','captured source execution requires its selected binding');
|
|
98
|
-
return source;
|
|
99
|
-
} catch(error) {if(captured && ['ENOENT','ENOTDIR'].includes(error.code)) fail('E_SOURCE','captured command requires its durable registered source descriptor');throw error;}
|
|
100
|
-
};
|
|
101
|
-
// Deliberate old registered-source replay is a separate qualified contract,
|
|
102
|
-
// never a way to create a source or synthesize generic admission. A present
|
|
103
|
-
// invalid/unadmitted generic invocation cannot enter this compatibility path.
|
|
104
|
-
if(captured && !execution && Object.hasOwn(accepted,event) && event!=='soul-scaffold') {
|
|
105
|
-
if(!fs.existsSync(flags.source?resolve(flags.source):markerPath(home))) fail('E_ADMISSION','new captured registration requires generic admitted invocation inputs');
|
|
106
|
-
src();
|
|
107
|
-
}
|
|
108
|
-
if(['spawn','retire'].includes(event)) {
|
|
109
|
-
// A generic intent authorizes its action, not missing source/role input.
|
|
110
|
-
// Absence may replay an already qualified source, never create one or
|
|
111
|
-
// infer a helper skip from an ambient kind/name/knowledge-slot heuristic.
|
|
112
|
-
if(captured && sourceReceipt.mode!=='captured' && !fs.existsSync(markerPath(home))) fail('E_SOURCE','new captured registration requires SourceReceipt1 input authority');
|
|
113
|
-
if(execution && fs.existsSync(markerPath(home))) src();
|
|
114
|
-
if(!captured && fs.existsSync(join(home,'instance.json')) && Object.hasOwn(readJSON(safePath(join(home,'instance.json'))),'executionBinding')) fail('E_INVOCATION','captured home cannot use legacy lifecycle ingress');
|
|
115
|
-
}
|
|
116
|
-
// Scope commands have no kernel instance intent. They may finish only
|
|
117
|
-
// already retained runs under their exact source binding/descriptor, never
|
|
118
|
-
// allocate a new worker or infer an incarnation for a deleted source.
|
|
119
|
-
const retainedRun=s=>{
|
|
120
|
-
const id=event==='complete'?flags.run:loadStatus(s).activeRun;
|
|
121
|
-
if(!id) {if(event==='complete') fail('E_RUN','complete requires an existing --run');requireQualifiedHelper(s);}
|
|
122
|
-
readRun(s,id);return s;
|
|
123
|
-
};
|
|
124
|
-
let result;
|
|
125
|
-
if(event==='read') fail('E_REMOVED','okf 4.0.0 removed read: use `oats okf cat --base ALIAS PATH` (same path, text and receipt)');
|
|
126
|
-
if(consult) {const answer=CONSULT[event](src(),flags,positionals);result=answer.result;text=answer.text;}
|
|
127
|
-
else if(event==='refresh') fail('E_REMOVED','okf 3.0.0 has no per-instance views; index/cat always read the accepted state: run `oats okf index`, then `oats okf cat --base ALIAS PATH`');
|
|
128
|
-
else if(event==='harvest-status') result=harvestStatus({home,flags});
|
|
129
|
-
else if(event==='soul-scaffold') {
|
|
130
|
-
// Souls are portable declarations, never an implicit knowledge store.
|
|
131
|
-
result={meta:{scaffolded:false},brief:'OKF requires explicit external bindings and soul/okf.json before a working instance can spawn. Use init or migrate; no knowledge was created in this soul.'};
|
|
132
|
-
} else if(event==='spawn') {
|
|
133
|
-
const s=sourceReceipt.mode==='captured'?registerCaptured(home,sourceReceipt.receipt):register(home);
|
|
134
|
-
const nodes=(list)=>list.join(', ') || 'none';
|
|
135
|
-
const brief=decl=>`Your soul knowledge is read remotely at its accepted state; there is no local copy. Start every task with your instance knowledge (STATE.md, log.md, notes/), then \`oats okf index\` (owns: ${nodes(decl.owns)}; reads: ${nodes(decl.reads.filter(r=>!decl.owns.includes(r)))}) and \`oats okf cat --base ALIAS PATH\` for the concepts the task needs; \`oats okf search\` before re-deriving a decision. Load okf-consultation and okf-instance-knowledge. Never edit accepted knowledge.`;
|
|
136
|
-
if(s.skipped) result={meta:{memory:'none'},brief:'Service agent: follow your own task; no working-memory upkeep.'};
|
|
137
|
-
else if(s.harvestOff) result={meta:{memory:'okf-v2',harvest:'off',reason:s.switch.reason},brief:`${brief(s.decl)} Harvest is off for this instance: nothing of this session is captured.`,...(s.switch.warnings.length?{warning:`oats-okf: ${s.switch.warnings.join('; ')}`}:{})};
|
|
138
|
-
else {
|
|
139
|
-
const schedule=loadStatus(s).schedule.result;
|
|
140
|
-
result={meta:{memory:'okf-v2',harvest:'on',source:s.file,schedule},brief:`${brief(s.decl)} Harvest is on: your notes and session are captured for the knowledge harvester.`};
|
|
141
|
-
}
|
|
142
|
-
} else if(event==='retire') {
|
|
143
|
-
if(captured) {
|
|
144
|
-
let s;
|
|
145
|
-
if(sourceReceipt.mode==='captured') {s=registerCaptured(home,sourceReceipt.receipt);if(s.skipped) {result={meta:{retired:true,reason:'service'}};s=null;}}
|
|
146
|
-
else {if(!fs.existsSync(markerPath(home))) fail('E_MIGRATION','captured retire requires a durable registered source or explicit helper receipt');s=src();}
|
|
147
|
-
if(s) {scheduleSource(s);const r=capture(s,{final:true});const schedule=settleRetiredSchedule(s);result={meta:{retired:r.complete===true,source:s.file,capture:r,schedule},brief:'Final input is in durable custody. Delivery remains asynchronous.'};}
|
|
148
|
-
} else if(service(home)) result={meta:{retired:true}};
|
|
149
|
-
else if(!fs.existsSync(markerPath(home)) && harvestOffRecord(home)) result={meta:{retired:true,reason:'harvest-off'}};
|
|
150
|
-
else if(!fs.existsSync(markerPath(home))) {
|
|
151
|
-
if(['STATE.md','log.md','notes','.okf-harvest-record.json','.okf-harvest-record.next.json'].some(p=>fs.existsSync(join(home,p)))) fail('E_MIGRATION','unregistered/legacy source has memory; explicitly migrate/register before retirement');
|
|
152
|
-
result={meta:{retired:true,reason:'nothing-to-delete'}};
|
|
153
|
-
} else {
|
|
154
|
-
const s=src(),sw=sourceSwitch(s);
|
|
155
|
-
// okf 4.0.1 #6: harvest switched off since spawn (deployment or soul) → no final capture.
|
|
156
|
-
if(sw.effective!=='on') result={meta:retireHarvestOff(s,sw),brief:`Harvest is now off (${sw.reason}): no final capture was taken; earlier inputs stay in custody.`};
|
|
157
|
-
else {scheduleSource(s);const r=capture(s,{final:true});const schedule=settleRetiredSchedule(s);result={meta:{retired:r.complete===true,source:s.file,capture:r,schedule},brief:'Final input is in durable custody. Delivery remains asynchronous.'};}
|
|
158
|
-
}
|
|
159
|
-
} else if(event==='harvest') {
|
|
160
|
-
if(capturedHarvest) {
|
|
161
|
-
const s=src(); // existing registered descriptor ONLY; never new registration.
|
|
162
|
-
result=runSource(s,{manual:true,noLaunch:!!flags['no-launch']||flags['worker-mode']==='prepare',capturedInvocation:execution.context,nativeRequest:flags['native-request']});
|
|
163
|
-
} else {
|
|
164
|
-
if(flags['native-request']||flags['worker-mode'])fail('E_USAGE','native-request/worker-mode require an admitted captured operation');
|
|
165
|
-
// Snapshot absence does not turn a persisted captured source into legacy.
|
|
166
|
-
if(fs.existsSync(markerPath(home))) requireQualifiedHelper(src());
|
|
167
|
-
const s=register(home);
|
|
168
|
-
if(s.harvestOff) fail('E_HARVEST_OFF',`harvest is off for this instance: ${s.switch.reason}. Nothing was captured.`);
|
|
169
|
-
result=s.skipped?{status:'skipped',reason:'service'}:runSource(s,{manual:true,noLaunch:!!flags['no-launch']});
|
|
170
|
-
}
|
|
171
|
-
} else if(event==='run-source') {
|
|
172
|
-
// The deployment can switch harvest off after a source registered: the
|
|
173
|
-
// job then captures and processes nothing (the soul's opt-out was already
|
|
174
|
-
// applied at registration). Nothing drains when it is switched back on.
|
|
175
|
-
const source=src(),sw=sourceSwitch(source);
|
|
176
|
-
result=sw.effective!=='on'?{status:'harvest-off',source:source.file,reason:`${sw.reason}; nothing was captured`}
|
|
177
|
-
:runSource(source,{manual:!!flags.manual,noLaunch:!!flags['no-launch']});
|
|
178
|
-
}
|
|
179
|
-
else if(event==='complete') {const s=src();if(captured) retainedRun(s);result=complete(s,flags.run,flags.judgment && resolve(flags.judgment));}
|
|
180
|
-
else if(event==='retry') {const s=src();if(captured && !flags.run && !flags.rejudge && !flags.launch && !flags['adopt-home']) retainedRun(s);result=retry(s,{run:flags.run,rejudge:!!flags.rejudge,launch:!!flags.launch,adoptHome:flags['adopt-home']});}
|
|
181
|
-
else if(event==='inspect') result=inspect(src());
|
|
182
|
-
else if(event==='setup' && flags.harvest!==undefined) {
|
|
183
|
-
if(flags.source || flags.enable || flags.disable || flags['install-host']) fail('E_USAGE','setup --harvest takes no other setup flag');
|
|
184
|
-
result=setupHarvest(flags.harvest);
|
|
185
|
-
}
|
|
186
|
-
else if(event==='setup') {
|
|
187
|
-
const s=src();if(flags.enable && flags.disable) fail('E_USAGE','choose enable or disable');
|
|
188
|
-
scheduleSource(s);
|
|
189
|
-
if(flags.enable || flags.disable) {oats(['schedule',flags.enable?'enable':'disable',`okf-${s.id}`,'--dir',s.context,'--json'],s.context);updateStatus(s,current=>{current.auto=!!flags.enable;});}
|
|
190
|
-
if(flags['install-host']) oats(['schedule','host','install','--dir',s.context,'--json'],s.context);
|
|
191
|
-
result={source:s.file,scheduler:oats(['schedule','list','--dir',s.context,'--json'],s.context).scheduler};
|
|
192
|
-
} else if(event==='init') result=initBase(loadBindings(),flags.base,flags.nodes,flags.output,{confirm:!!flags.confirm});
|
|
193
|
-
else if(event==='migrate') {
|
|
194
|
-
if(flags['source-home']) result=migrateSource(loadBindings(),flags['source-home']);
|
|
195
|
-
else if(flags.forget) result=forgetMigration(loadBindings(),flags.forget);
|
|
196
|
-
else if(flags.deliver) result=deliverMigration(resolve(flags.deliver));
|
|
197
|
-
else if(flags.cutover) result=cutoverMigration(resolve(flags.cutover),flags['soul-dir']);
|
|
198
|
-
else result=migrate(loadBindings(),{legacy:flags.legacy,alias:flags.base,node:flags.node,output:flags.output});
|
|
199
|
-
} else if(event==='unlock') result=unlock(resolve(flags.lock),flags.token);
|
|
200
|
-
else fail('E_USAGE',`unknown command ${event}; see --help`);
|
|
201
|
-
answer=hook?result:{schemaVersion:1,ok:true,result};
|
|
202
|
-
} catch(e) {const code=e.code || 'E_OKF',message=redactUrls(e.message);exit=1;answer=hook?{meta:{...(event==='retire'?{retired:false,reason:message}:{})},warning:`oats-okf ${code}: ${message}`}:{schemaVersion:1,ok:false,error:{code,message}};}
|
|
203
|
-
// Consult commands print text unless --json; every other answer is JSON.
|
|
204
|
-
// Let Node drain the pipe; no process.exit after a possibly large answer.
|
|
205
|
-
if(textMode && exit) process.stderr.write(`oats okf ${event}: ${answer.error.code}: ${answer.error.message}\n`);
|
|
206
|
-
else if(textMode) process.stdout.write(text+'\n');
|
|
207
|
-
else process.stdout.write(JSON.stringify(answer)+'\n');
|
|
208
|
-
process.exitCode=exit;
|
|
209
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
## Knowledge: OKF
|
|
2
|
-
|
|
3
|
-
You have two kinds of knowledge. Work WITH both: consult them at the start of
|
|
4
|
-
every task, after compaction, and every so often while you work, to decide,
|
|
5
|
-
to situate the task and to stay coherent with what your soul already knows.
|
|
6
|
-
|
|
7
|
-
- **Soul knowledge**: your soul's accepted OKF bases, external to the soul and
|
|
8
|
-
read remotely at their accepted state (there is no local copy).
|
|
9
|
-
**Consultation** reads them with the `oats okf` CLI from your instance home.
|
|
10
|
-
Load the **okf-consultation** skill at the start of every task.
|
|
11
|
-
- **Instance knowledge**: this instance's own STATE.md, log.md and notes/ in
|
|
12
|
-
instance home. Load the **okf-instance-knowledge** skill: it teaches what is
|
|
13
|
-
worth capturing, not only where to put it.
|
|
14
|
-
|
|
15
|
-
The work mode:
|
|
16
|
-
- **At task start and after compaction:** read STATE.md, recent log.md
|
|
17
|
-
entries and the relevant notes/, then `oats okf index` and
|
|
18
|
-
`oats okf cat --base ALIAS PATH` for the concepts the task needs. Follow
|
|
19
|
-
links; do not bulk-load.
|
|
20
|
-
- **Before compaction and before a task boundary:** update STATE.md, log.md
|
|
21
|
-
and notes/ first, so your future self can continue.
|
|
22
|
-
- **Every so often while working, and always before a design decision or
|
|
23
|
-
before re-deriving something:** `oats okf search` / `cat` the relevant
|
|
24
|
-
concepts and re-read your own notes. Consult prior decisions before
|
|
25
|
-
re-deriving them.
|
|
26
|
-
- Cite what you relied on as `alias/node/concept.md@<short-oid>`. A Git PR is
|
|
27
|
-
not accepted knowledge until it is merged. Report missing configuration or
|
|
28
|
-
blocked reads; do not create a substitute.
|
|
29
|
-
|
|
30
|
-
**Capture with judgment**, as it happens: decisions and why, rejected
|
|
31
|
-
alternatives, costly discoveries, limitations and the workaround that worked,
|
|
32
|
-
conclusions, blockers, human direction and corrections, and surprises that
|
|
33
|
-
contradict soul knowledge (flag those as candidate supersessions). Not code
|
|
34
|
-
descriptions, command logs, retries, secrets, verbatim third-party messages,
|
|
35
|
-
or what the tracker and docs already hold. One concept per note in notes/;
|
|
36
|
-
STATE.md is the current picture (rewritten); log.md is dated events
|
|
37
|
-
(append-only). The knowledge harvester, not you, decides what is promoted.
|
|
38
|
-
|
|
39
|
-
**Never write accepted knowledge or soul knowledge.** This is an instruction
|
|
40
|
-
boundary, not a filesystem sandbox. Skills remain curated soul artifacts.
|
|
41
|
-
Instance knowledge lives in instance home, not ./work; code and repository
|
|
42
|
-
documentation remain the truth about code.
|