@chrok/braid 0.1.0 → 0.1.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/CHANGELOG.md CHANGED
@@ -2,7 +2,18 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
- No changes yet.
5
+ ## 0.1.1 — 2026-09-27
6
+
7
+ - Validate the Pi integration against Pi 0.87.1; update GitHub Actions and tsx.
8
+ - Group routine dependency updates and reserve Node/TypeScript major upgrades
9
+ for deliberate compatibility changes across both packages.
10
+ - Clarify Pi tool and context guidance for parallel implementation and merge
11
+ nodes; describe read-only filesystem access by the node's assigned workspace
12
+ instead of assuming its directory is outside Git.
13
+ - Trim OpenAI-compatible base URL trailing slashes in linear time, avoiding
14
+ excessive regular-expression backtracking on long internal slash sequences.
15
+ - Protect the main branch and version tags; document repository governance,
16
+ CodeQL checks, Actions restrictions, and immutable releases.
6
17
 
7
18
  ## 0.1.0 — 2026-09-27
8
19
 
package/CONTRIBUTING.md CHANGED
@@ -29,6 +29,12 @@ calls a model. `npm test` is the fast core-only loop; `npm run test:pi` tests Pi
29
29
 
30
30
  ## Changes and reviews
31
31
 
32
+ Submit changes to `main` through a pull request, including maintainer changes.
33
+ Keep the branch up to date, pass the required CI and CodeQL checks, and resolve
34
+ review conversations before squash merging. See the
35
+ [repository policies](docs/repository-settings.md) for the complete settings and
36
+ the current single-maintainer review policy.
37
+
32
38
  - Keep the TypeScript strict checks passing. Follow nearby code and the
33
39
  repository's two-space formatting; use explicit public types.
34
40
  - For behavior changes, add a regression test that fails before the change.
package/README.md CHANGED
@@ -73,7 +73,7 @@ before running a custom adapter against a repository.
73
73
 
74
74
  ## Install in Pi
75
75
 
76
- With Pi 0.85.1 and Node.js 22.19+:
76
+ With Pi 0.87.1 and Node.js 22.19+:
77
77
 
78
78
  ```sh
79
79
  pi install npm:@chrok/pi-braid
package/ROADMAP.md CHANGED
@@ -18,6 +18,10 @@ Published versions are listed in [GitHub releases](https://github.com/Epsirom/br
18
18
 
19
19
  ## Next candidates
20
20
 
21
+ - Migrate both packages from TypeScript 5 to 7 in one dedicated change. Explicitly
22
+ load Node types, review compiler default changes, and validate public declaration
23
+ consumption, package builds, and the complete Node/platform matrix. Keep Node
24
+ declarations on 22.x while Node 22 remains the minimum supported runtime.
21
25
  - Measure real applications before changing scheduler data structures.
22
26
  - Discuss optional per-run node/output limits and host-wide admission controls.
23
27
  - Define budget semantics that account for missing usage and in-flight calls
@@ -65,7 +65,11 @@ function parseCompletion(value) {
65
65
  export function createOpenAICompatibleRunner(options = {}) {
66
66
  const { apiKey, defaultModel } = options;
67
67
  const fetchImpl = options.fetch ?? globalThis.fetch;
68
- const url = `${(options.baseURL ?? "https://api.openai.com/v1").replace(/\/+$/, "")}/chat/completions`;
68
+ const baseURL = options.baseURL ?? "https://api.openai.com/v1";
69
+ let end = baseURL.length;
70
+ while (end > 0 && baseURL[end - 1] === "/")
71
+ end--;
72
+ const url = `${baseURL.slice(0, end)}/chat/completions`;
69
73
  return async (request) => {
70
74
  const model = request.model ?? defaultModel;
71
75
  if (!model)
@@ -3,7 +3,7 @@
3
3
  | Surface | Supported / tested contract |
4
4
  | --- | --- |
5
5
  | Core runtime | Node.js 22+, ESM imports, TypeScript declarations, no runtime dependencies |
6
- | Pi package | Node.js 22.19+, Pi 0.85.1 is the pinned validation target |
6
+ | Pi package | Node.js 22.19+, Pi 0.87.1 is the pinned validation target |
7
7
  | CI | Core minimum Node 22.0; both packages on Node 22.19 and 24 on Linux, macOS, Windows |
8
8
  | OpenAI-compatible runner | Chat Completions text and function-tool calls; decisions and merge nodes require tool calling |
9
9
  | Browsers / CommonJS | No supported browser build or CommonJS entry point in 0.1 |
@@ -14,9 +14,15 @@ that every provider advertising OpenAI compatibility supports its tool schema.
14
14
  Run a small opt-in live test with your chosen provider before relying on it.
15
15
 
16
16
  Pi's upstream packaging guide requires `*` peer dependencies for packages the
17
- host provides. Braid follows that convention and pins dev dependencies to 0.85.1.
17
+ host provides. Braid follows that convention and pins dev dependencies to 0.87.1.
18
18
  The wildcard is a loader/distribution convention, **not a claim that every Pi
19
19
  version works**. Test the whole Pi suite before updating the supported target.
20
+ The offline host compatibility test loads the extension into a real Pi session
21
+ with an in-memory model provider. It checks worker prompt/tool normalization and
22
+ exactly one automatic continuation when a job finishes during `agent_settled`.
23
+ This covers the Pi 0.86/0.87 transcript and settling changes without provider
24
+ credentials or network model calls. Version 0.1.0 was originally validated with
25
+ Pi 0.85.1; the current checkout's pinned validation target is 0.87.1.
20
26
  The Pi npm package compiles and includes the same core source as the matching
21
27
  core release, so it does not need another installed copy of Braid or a checkout.
22
28
 
package/docs/releasing.md CHANGED
@@ -6,6 +6,10 @@ source so its installed extension never reaches outside its own package.
6
6
 
7
7
  ## Prepare a release
8
8
 
9
+ Version tags (`v*`) cannot be moved or deleted. New GitHub releases are immutable:
10
+ prepare a draft and attach any assets before publishing. Published tag/asset
11
+ corrections require a new version. See [repository settings](repository-settings.md).
12
+
9
13
  1. Update both `package.json` versions and both lockfiles. Use a minor version
10
14
  for breaking 0.x changes, and describe migrations in the changelog.
11
15
  2. Run `npm ci`, `npm ci --prefix integrations/pi`, and `npm run verify`.
@@ -18,6 +22,11 @@ source so its installed extension never reaches outside its own package.
18
22
 
19
23
  ## First publication
20
24
 
25
+ Enable two-factor authentication in the npm account's web settings before the
26
+ first publish. An emailed login code does not replace enrolling a security key
27
+ or passkey for publishing. Complete credential enrollment yourself and keep
28
+ recovery codes private.
29
+
21
30
  Log in locally with `npm login --registry=https://registry.npmjs.org`; confirm the
22
31
  account with `npm whoami`. Publish the core with `npm publish --access public`,
23
32
  then run `npm publish --access public` from `integrations/pi`. Complete npm's
@@ -25,7 +34,12 @@ interactive account/2FA checks if requested. Never put credentials in source,
25
34
  issues, shell history, or CI logs. An npm registration alone does not guarantee
26
35
  ownership of a previously used package name.
27
36
 
28
- After publication, install the registry versions in a fresh project and verify
37
+ New packages may temporarily return `E404` after a successful publish while npm
38
+ runs its [publish-time scan](https://github.blog/changelog/2026-07-28-npm-publish-time-malware-scanning-and-dual-use-metadata/).
39
+ Allow time for the exact versions to become available through `npm view`; do not
40
+ republish or bump versions just to work around this delay.
41
+
42
+ After availability is confirmed, install the registry versions in a fresh project and verify
29
43
  both exported core entry points and the Pi extension. Add the actual publication
30
44
  date to the changelog and create the corresponding GitHub release.
31
45
 
@@ -39,6 +53,15 @@ For **each** package, configure an npm GitHub trusted publisher:
39
53
  - Environment: leave blank (this workflow does not declare one)
40
54
  - Allow direct `npm publish`
41
55
 
56
+ With npm 11.20 or later, the equivalent CLI setup is:
57
+
58
+ ```sh
59
+ npm trust github @chrok/braid --file release.yml --repo Epsirom/braid --allow-publish
60
+ npm trust github @chrok/pi-braid --file release.yml --repo Epsirom/braid --allow-publish
61
+ npm trust list @chrok/braid
62
+ npm trust list @chrok/pi-braid
63
+ ```
64
+
42
65
  Publishing a non-prerelease GitHub release triggers `.github/workflows/release.yml`.
43
66
  It validates the tag/version relationship, repeats all checks, and publishes
44
67
  core then Pi using short-lived OIDC credentials. It does not require `NPM_TOKEN`.
@@ -0,0 +1,82 @@
1
+ # Repository settings
2
+
3
+ The live [GitHub rulesets](https://github.com/Epsirom/braid/rules) enforce these
4
+ policies. JSON files in [.github/rulesets](../.github/rulesets) are reviewable
5
+ copies of the API payloads; committing a change to them does not apply it to
6
+ GitHub automatically. Update the existing ruleset in Settings or through the
7
+ REST API after reviewing a policy change, then verify the live settings.
8
+
9
+ ## Main branch
10
+
11
+ [Protect main](https://github.com/Epsirom/braid/rules/24072177) applies to `main`,
12
+ including administrators, with no bypass actors:
13
+
14
+ - Changes must go through a pull request. Direct pushes, force pushes, and
15
+ branch deletion are blocked.
16
+ - All review conversations must be resolved. New commits dismiss previous
17
+ approvals.
18
+ - The branch must be up to date and all seven CI checks must pass: `core-minimum`
19
+ and `verify` on Ubuntu, macOS, and Windows with Node 22.19.0 and 24. Checks must
20
+ originate from the GitHub Actions app.
21
+ - CodeQL must supply analysis results. Code scanning errors and new security
22
+ findings rated high or critical block merging.
23
+ - Squash is the only merge method, keeping a linear history. The squash commit
24
+ uses the PR title and description.
25
+
26
+ There is currently one maintainer with write access. Required approval count is
27
+ therefore zero: GitHub does not allow authors to approve their own PRs.
28
+ [CODEOWNERS](../.github/CODEOWNERS) requests maintainer review for contributions,
29
+ but code-owner approval and approval of the last push are not mandatory. When a
30
+ second maintainer joins, require at least one approving review and consider
31
+ requiring code-owner and last-push approval. CI and PR requirements apply to the
32
+ current maintainer as well.
33
+
34
+ Automatic merge is available when explicitly enabled for a PR; it still waits
35
+ for the rules above. GitHub offers an Update branch button and deletes merged
36
+ head branches automatically. Do not bypass a failing check to merge a change.
37
+
38
+ ## Releases
39
+
40
+ [Protect version tags](https://github.com/Epsirom/braid/rules/24072178) prevents
41
+ updates and deletion of `v*` tags, with no bypass actors. New version tags can
42
+ still be created by maintainers.
43
+
44
+ Immutable releases are enabled for future releases. Prepare a draft and upload
45
+ any assets before publishing; the release tag and assets become immutable when
46
+ published. This setting does not retroactively make existing releases immutable.
47
+ Use a new version for a correction. See [the release guide](releasing.md).
48
+
49
+ ## Actions and security
50
+
51
+ - Actions use read-only `GITHUB_TOKEN` permissions by default and cannot create
52
+ or approve PRs through that token. Individual workflows request only their
53
+ needed permissions; the release job uses `id-token: write` for npm OIDC.
54
+ - External actions and reusable workflows are limited to GitHub-owned
55
+ repositories; local actions remain allowed. External actions must be pinned
56
+ to full commit SHAs. Review and explicitly allow any future third-party action
57
+ before using it.
58
+ - Workflows from all external fork contributors require maintainer approval
59
+ before running. Inspect workflow and code changes before approving a run.
60
+ - CodeQL default setup scans GitHub Actions and JavaScript/TypeScript with the
61
+ default query suite and remote threat model, including its weekly schedule.
62
+ - Dependabot alerts/security updates, secret scanning, secret push protection,
63
+ and private vulnerability reporting are enabled. Dependency updates remain
64
+ configured in [.github/dependabot.yml](../.github/dependabot.yml).
65
+
66
+ These are repository settings, not organization-wide changes. Neither commit
67
+ sign-off nor a CLA is required for contributions.
68
+
69
+ ## Dependency maintenance
70
+
71
+ Dependabot checks both npm manifests weekly. Pi host packages stay in a separate
72
+ group because even 0.x minor releases can change extension contracts. Other npm
73
+ minor/patch updates are grouped; GitHub Actions updates are grouped monthly and
74
+ retain full commit SHA pins. Grouping does not enable automatic merging.
75
+
76
+ Keep `@types/node` on 22.x to match the oldest supported Node major. TypeScript
77
+ major upgrades require a coordinated migration of core and Pi, including the
78
+ standalone package/declaration checks; the current migration is tracked in the
79
+ [roadmap](../ROADMAP.md). Automatic major version updates for these two packages
80
+ are ignored until their compatibility policy changes. Minor/patch updates,
81
+ vulnerability alerts, and security-update configuration remain enabled. Review
82
+ any security fix that requires crossing an ignored major version manually.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chrok/braid",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "license": "MIT",
5
5
  "description": "A small, framework-agnostic DAG runtime for isolated model invocations",
6
6
  "type": "module",
@@ -47,7 +47,7 @@
47
47
  },
48
48
  "devDependencies": {
49
49
  "@types/node": "^22.0.0",
50
- "tsx": "^4.0.0",
50
+ "tsx": "^4.23.15",
51
51
  "typescript": "^5.0.0"
52
52
  },
53
53
  "repository": {