@xingular/harness 1.3.1-unstable.9 → 1.4.0-unstable

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 (69) hide show
  1. package/CHANGELOG.md +42 -6
  2. package/NOTICE.md +26 -0
  3. package/builtin/skills/plugin-authoring/SKILL.md +20 -1
  4. package/dist/cli.js +1035 -163
  5. package/dist/sdk/commands/registry.d.ts +7 -0
  6. package/dist/sdk/commands/registry.js +1 -0
  7. package/dist/sdk/plugins/discover.js +80 -4
  8. package/dist/sdk/plugins/install.js +26 -0
  9. package/dist/sdk/plugins/manifest.d.ts +2 -0
  10. package/dist/sdk/plugins/manifest.js +20 -1
  11. package/dist/sdk/prompt/compile.d.ts +4 -3
  12. package/dist/sdk/prompt/compile.js +4 -18
  13. package/dist/sdk/prompt/reporting.d.ts +2 -0
  14. package/dist/sdk/prompt/reporting.js +282 -0
  15. package/dist/sdk/prompt/standard.d.ts +12 -0
  16. package/dist/sdk/prompt/standard.js +53 -2
  17. package/dist/sdk/sessions/completionCheck.d.ts +8 -10
  18. package/dist/sdk/sessions/completionCheck.js +21 -26
  19. package/dist/sdk/sessions/contracts.d.ts +90 -0
  20. package/dist/sdk/sessions/contracts.js +13 -0
  21. package/dist/sdk/sessions/goal.d.ts +145 -0
  22. package/dist/sdk/sessions/goal.js +405 -0
  23. package/dist/sdk/sessions/goalLoop.d.ts +37 -0
  24. package/dist/sdk/sessions/goalLoop.js +125 -0
  25. package/dist/sdk/sessions/goalPrompts.d.ts +4 -0
  26. package/dist/sdk/sessions/goalPrompts.js +93 -0
  27. package/dist/sdk/sessions/runStore.js +1 -0
  28. package/dist/sdk/sessions/runner.d.ts +7 -1
  29. package/dist/sdk/sessions/runner.js +13 -12
  30. package/dist/sdk/sessions/sessions.d.ts +10 -0
  31. package/dist/sdk/sessions/sessions.js +44 -4
  32. package/dist/sdk/sessions/stopGate.d.ts +16 -27
  33. package/dist/sdk/sessions/stopGate.js +32 -60
  34. package/dist/sdk/sessions/workSlice.d.ts +2 -0
  35. package/dist/sdk/sessions/workSlice.js +1 -1
  36. package/dist/sdk/terminal/piExtension.d.ts +2 -1
  37. package/dist/sdk/terminal/piExtension.js +68 -13
  38. package/dist/sdk/terminal/terminals.js +2 -1
  39. package/dist/sdk/terminal/tui/commands.d.ts +2 -0
  40. package/dist/sdk/terminal/tui/commands.js +3 -0
  41. package/dist/sdk/terminal/tui/goalCommand.d.ts +19 -0
  42. package/dist/sdk/terminal/tui/goalCommand.js +83 -0
  43. package/dist/sdk/terminal/tui/runtime.d.ts +3 -0
  44. package/dist/sdk/terminal/tui/runtime.js +7 -1
  45. package/dist/sdk/tools/askUser.js +1 -1
  46. package/dist/sdk/tools/todo.js +2 -1
  47. package/dist/terminal-opentui.js +839 -119
  48. package/dist/terminal-pi.js +387 -80
  49. package/docs/architecture/02-sessions-and-runs.md +28 -20
  50. package/docs/architecture/04-prompt.md +73 -52
  51. package/docs/architecture/06-plugins-and-capabilities.md +16 -1
  52. package/docs/architecture/07-tools-and-gate.md +7 -4
  53. package/docs/architecture/10-server-protocol.md +13 -6
  54. package/docs/architecture/11-terminal.md +23 -7
  55. package/docs/decisions/ADR-0008-flexible-reporting-guidance.md +3 -0
  56. package/docs/decisions/ADR-0068-scope-and-completion-report.md +5 -2
  57. package/docs/decisions/ADR-0071-completion-check.md +3 -2
  58. package/docs/decisions/ADR-0072-codex-prompts-and-goal.md +105 -0
  59. package/docs/decisions/ADR-0073-large-reporting-prompt.md +84 -0
  60. package/docs/parity.md +4 -1
  61. package/docs/releases/1.4.0-unstable.md +18 -0
  62. package/docs/releases/README.md +1 -1
  63. package/docs/study/00-index.md +7 -0
  64. package/docs/study/STUDY-0004-turn-end-controls.md +2 -0
  65. package/docs/study/STUDY-0005-skill-installation-guidance.md +146 -0
  66. package/docs/study/STUDY-0006-reporting-prompts.md +81 -0
  67. package/docs/study/arms/04-skills.md +6 -0
  68. package/docs/terminal-tui.md +17 -7
  69. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -2,7 +2,43 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
- - **A completion check replaces `finish` (ADR-0071).**
5
+ - **A large, content-block reporting prompt (ADR-0073).**
6
+ - The `reporting` section in `src/prompt/reporting.ts` is about 15.8k characters: outcome first,
7
+ required what-changed / how-to-test / what-to-do-next blocks for a change, optional beyond,
8
+ departures, unverified and open-question blocks, five worked examples and an anti-pattern table.
9
+ - Headings are the model's choice; the three fixed headings from ADR-0068 are gone.
10
+ - `REPORTING_BUDGET` rises to 18,000, and the section is never cut.
11
+ - The peer study is `docs/study/STUDY-0006-reporting-prompts.md`.
12
+ - **Skill installation guidance and package skill layouts.**
13
+ - The release-owned `plugin-authoring` skill now says where a skill is installed (a project's
14
+ `.pi/skills` and `.agents/skills`, the user's `~/.agents/skills`, the shared state folder), to
15
+ copy a whole skill folder, and that `.claude/skills` is never read. It also says which installs
16
+ only a person commits, and that `plugin_propose` is not an install route.
17
+ - `plugins.install` refuses a GitHub or GitLab `tree`/`blob` page address with the repository
18
+ address and the skill routes, instead of a raw git error.
19
+ - A package's foreign plugin manifest (`plugin.json`, `.claude-plugin/plugin.json`,
20
+ `.codex-plugin/plugin.json`) may declare `skills`; those folders load as package skills, under
21
+ the package's switch and filter.
22
+
23
+ - **Codex's prompts and `/goal`; the completion check moves behind `/goal` (ADR-0072).**
24
+ - **Ordinary replies.** No model-judged check runs on them. The todo gate stays and says the list
25
+ is progress, not the limit of the work; `TODO_GUIDANCE` now says the request is the scope.
26
+ - **Prompt.** A person's own session reads Codex's autonomy and persistence, when-to-ask,
27
+ steering and compaction, and writing-style rules as separate sections, and a longer reporting
28
+ section: unfinished work says so on the first line, with the reason and the next step.
29
+ `ask_user` is never used to ask permission, and no answer means continue.
30
+ - **Failures from outside the session.** A test or error that does not come from the session's
31
+ work is reported with its command and output, not fixed, unless the person asks. It stays off
32
+ the todo list, and it is a reason to stop that the autonomy rules name.
33
+ - **`/goal <objective>`.** A long run the person starts. Codex's `get_goal` and `update_goal`,
34
+ continuation, round-cap and edit prompts, `blocked` after the same blocker on three turns, and
35
+ brakes for idle, failing and erroring rounds. `/goal edit|pause|resume|clear`, a footer label,
36
+ Esc pauses. Caps: 30 rounds or 8 hours (`--rounds`, `--hours`).
37
+ - **A completion claim is checked** once by the same model at low effort with a fresh context.
38
+ `sessions.run` takes `goal`; `run.json` records `goalMode`.
39
+ - **Fixed.** The check sends a session id, so opencode-go no longer answers 400 `MissingSessionID`.
40
+ - Adapted from OpenAI Codex (Apache-2.0); see `NOTICE.md`.
41
+ - **A completion check replaces `finish` (ADR-0071; the every-reply check is superseded by ADR-0072).**
6
42
  - **The check.** When a reply that did work ends with its todo list closed or absent, the run's
7
43
  own model, at low effort and with a fresh context, judges the person's request against what the
8
44
  reply did: `done`, `continue` (the reply is sent back with the reason and next step), or
@@ -91,11 +127,11 @@
91
127
  request plus new items, so Codex WebSocket continuation and prefix caching apply. Before, every later
92
128
  turn of a compacted session resent its whole context: one measured session fell from 94–99% to
93
129
  18–24% cache hits after its first compaction.
94
- - Flag a low prompt-cache hit rate in the terminal's composer status bar. `R<percentage>%` now covers the
95
- last 10 model responses instead of the whole session (`recentCacheUsage`, `CACHE_HIT_WINDOW`), and
96
- gets a yellow `⚠` below 70 percent and a red one below 40 percent. Each drop to a worse level posts
97
- one transcript notice. A window of one response, or one with no cache reads or writes, is not judged
98
- (`cacheHitLevel`, `CACHE_HIT_WARNING_PERCENT`, `CACHE_HIT_CRITICAL_PERCENT`).
130
+ - Flag a low prompt-cache hit rate in the terminal's composer status bar. `R<percentage>%` covers the last
131
+ 10 model responses instead of the whole session (`recentCacheUsage`, `CACHE_HIT_WINDOW`), and the rate
132
+ gets a yellow `⚠` below 70 percent and a red one below 40 percent. The warning stays in the status bar;
133
+ no cache-hit notice is added to the transcript. A window of one response, or one with no cache reads or
134
+ writes, is not judged (`cacheHitLevel`, `CACHE_HIT_WARNING_PERCENT`, `CACHE_HIT_CRITICAL_PERCENT`).
99
135
 
100
136
  - Refine a variant from the terminal and keep checkpoints of it (PROP-0052, ADR-0065, ADR-0066).
101
137
  `/refine [what to look at]` replays the latest request typed in this chat from a snapshot of the
package/NOTICE.md CHANGED
@@ -58,3 +58,29 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
58
58
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
59
59
  SOFTWARE.
60
60
  ```
61
+
62
+ ## OpenAI Codex
63
+
64
+ The standard session prompt (`src/prompt/standard.ts`: autonomy and persistence, when to ask the
65
+ person, steering and compaction, writing style), the final-reply rules in `REPORTING_GUIDANCE`
66
+ (`src/prompt/compile.ts`), the `/goal` prompts and tool descriptions (`src/sessions/goalPrompts.ts`,
67
+ `src/sessions/goal.ts`), the goal brakes and status text, and the `/goal` command
68
+ (`src/terminal/tui/goalCommand.ts`) adapt text and design from OpenAI Codex, mainly:
69
+
70
+ - `codex-rs/models-manager/models.json` (`instructions_template` of `gpt-6.1-sol` and `gpt-6-luna`);
71
+ - `codex-rs/ext/goal/templates/goals/{continuation,budget_limit,objective_updated}.md`;
72
+ - `codex-rs/ext/goal/src/{spec,tool,accounting,runtime,api}.rs`;
73
+ - `codex-rs/tui/src/{goal_display,slash_dispatch,goal_menu}.rs`;
74
+ - `codex-rs/collaboration-mode-templates/templates/default.md` (the `ask_user` rule).
75
+
76
+ Upstream: https://github.com/openai/codex (OpenAI Codex, Copyright 2025 OpenAI)
77
+
78
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use these files except
79
+ in compliance with the License. You may obtain a copy of the License at
80
+ https://www.apache.org/licenses/LICENSE-2.0. Unless required by applicable law or agreed to in
81
+ writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
82
+ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Changes from upstream: ported from
83
+ Rust to TypeScript for Pi; text about Codex's own channels and tools (commentary channel,
84
+ `apply_patch`, `functions.exec`, apps, plugins, visualizations) left out; the goal's token budget
85
+ became rounds and hours; `update_plan` became `todo_write`; completing a goal is a claim that the
86
+ harness checks; the model cannot create a goal.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: plugin-authoring
3
- description: Use when designing, building, testing, or packaging a Harness or Pi plugin, extension, skill, or terminal interaction.
3
+ description: Use when designing, building, testing, packaging, or installing a Harness or Pi plugin, extension, skill, or terminal interaction, including from a pasted folder or repository address.
4
4
  ---
5
5
 
6
6
  # Plugin authoring
@@ -12,6 +12,25 @@ description: Use when designing, building, testing, or packaging a Harness or Pi
12
12
  5. For a TUI audit, examine information hierarchy, layout, navigation, keyboard and focus, states, errors, accessibility and narrow and wide terminals. Study source and published screenshots as available; record which claims each source supports. Capture terminal images only with an available, authorized capture mechanism. A PTY text capture is not a screenshot; explicitly report unavailable visual evidence.
13
13
  6. Test registration, behavior, failure and cancellation paths, non-interactive fallback, and trust/permission boundaries. Run relevant checks. Use `plugin_propose` with a name, description and complete text files (omit `package.json`) to submit the package for person-controlled review. It does not install, enable or trust the plugin. Report the proposal ID, evidence and checks actually performed.
14
14
 
15
+ ## Installing an existing skill or plugin
16
+
17
+ A skill is a folder with a `SKILL.md`. Copy the whole folder, never only the `SKILL.md`, into a scope a session reads:
18
+
19
+ | Scope | Folder | Who writes it |
20
+ |---|---|---|
21
+ | This project | `<repo>/.agents/skills/<name>/` or `<repo>/.pi/skills/<name>/` | you, as project files |
22
+ | Every project of this operating-system user | `~/.agents/skills/<name>/` | you, but it is outside the workspace, so the write asks the person |
23
+ | Every account of this harness | `<state>/accounts/_shared/pi/skills/<name>/` | a person, when they want one shared copy |
24
+ | Variant, library, package, Hub | `skills/<name>/SKILL.md` | only a person commits these |
25
+
26
+ - Keep the folder name and the frontmatter `name` equal, and copy `reference/`, `scripts/` and every file the `SKILL.md` links to. Its relative references resolve against the skill folder.
27
+ - For a pasted folder or repository address, clone it into a temporary folder inside the workspace, find `<name>/SKILL.md`, and copy that folder whole. A `tree` or `blob` page address is not a package address: install the repository itself, or copy the skill folder as above. Never write into `.claude/skills`; this harness does not read it.
28
+ - A skill installed this way is available in the next session, not this one; say so.
29
+ - A variant holds `SKILL.md` and flat `scripts/` files only, so a skill with a `reference/` folder stays in the scopes above.
30
+ - `plugin_propose` is for a package you write. Do not propose someone else's skill as a way to install it: a proposal carries text only, is capped at 1 MiB, and becomes a local copy with no update path.
31
+
32
+ When the person asks for a variant, library, Hub or package install, name the exact step (`/skills`, `/components`, `/hub`, `/plugins`) and the source, and leave the commit to them.
33
+
15
34
  ## Terminal example
16
35
 
17
36
  For a small interactive command, prefer a built-in UI over a custom renderer: