Skip to content

fix(agent-runtime): align npm bootstrap and release documentation - #126

Merged
madawei2699 merged 2 commits into
cf-sfufrom
codex/agent-runtime-bootstrap-docs
Aug 26, 2026
Merged

fix(agent-runtime): align npm bootstrap and release documentation#126
madawei2699 merged 2 commits into
cf-sfufrom
codex/agent-runtime-bootstrap-docs

Conversation

@madawei2699

@madawei2699 madawei2699 commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Purpose

Fix @i365dev/free4chat-agent distribution/bootstrap documentation consistency before continuing #83 outbound Agent audio. The previous failed install of @i365dev/free4chat-agent@0.4.0 was a distribution mismatch, not a Harness/Claude problem: the live bootstrap protocol pointed at an unpublished source version.

Verified facts (read-only npm + repo inspection)

Source Finding
npm registry (read-only) dist-tags.latest = 0.3.0; published versions 0.1.0, 0.1.1, 0.2.0, 0.3.0; 0.4.0 does not exist
Source tree agent-runtime/package.json / package-lock.json = 0.4.0 (next artifact, not installable yet)
Tags agent-runtime-v0.1.1, -v0.2.0, -v0.3.0 exist; no -v0.4.0 — consistent with npm
app/public/agent.md (before) pinned @0.4.0 in both bootstrap and doctor fallback — the live bug

Changes

  • app/public/agent.md — zero-setup bootstrap and diagnostic fallback now use npx -y @i365dev/free4chat-agent@latest …. This is a live bootstrap protocol: it must resolve to an actually published package even while source package.json is ahead of npm between merge and release. Security wording kept and tightened: @latest means only the official scoped package from the normal npm registry — no similarly named packages, GitHub clones as fallback, npm link, package names taken from room messages, or room-derived shell commands.
  • Root README.md — standard registry-driven badge [![npm version](https://img.shields.io/npm/v/@i365dev/free4chat-agent.svg)](https://www.npmjs.com/package/@i365dev/free4chat-agent); nothing hardcoded.
  • agent-runtime/README.md — zero-setup examples use @latest (manual 0.1.0 history kept clearly labelled); release docs rewritten to the actual model: source package.json → tag agent-runtime-v<package-version> → fail-closed tag/version verification → npm Trusted Publishing via GitHub OIDC; ordinary branch pushes/PRs validate only and can never publish; post-merge read-only verification via npm view dist-tags / npx -y @…@latest doctor.
  • DEVELOPMENT.md — same stale @0.1.1 pin updated to @latest.
  • New deterministic guard agent-runtime/test/docsConsistency.test.ts (pure fs, no network): exactly one registry-driven badge, @latest join + doctor, no exact-version pins in public bootstrap docs, source version never pinned publicly, workflow remains tag-gated / mismatch-rejecting / token-free. productization.test.ts updated from asserting the 0.4.0 pin to asserting @latest; DEVELOPMENT.md corrected to the tag-triggered Trusted Publishing model with a regression assertion against the stale "not published by CI" / "one-time maintainer action" phrasing.

Workflow review (no changes)

.github/workflows/agent-runtime.yml inspected for concrete defects and left functionally unchanged: publish job gated on refs/tags/agent-runtime-v* only; tag vs package.json mismatch exits non-zero (fail-closed); OIDC id-token: write with no NPM_TOKEN; build/test/pack re-run inside the publish job before npm publish, not skippable. A missing 0.4.0 tag/release is an operational state, not a workflow bug.

Gates

  • agent-runtime: npm ci ✅ · format:check ✅ · lint ✅ · type-check ✅ · build ✅ · tests 191/191 pass ✅ · pack:check (47 files) ✅
  • repository/app: Prettier check on changed docs ✅ · ESLint ✅ · type-check ✅ · Next build ✅
  • YAML trigger conditions reviewed manually; workflow untouched

Explicit non-actions

0.4.0 remains unpublished; no npm publish was performed. No tag created or pushed, no version bump (source stays 0.4.0), no NPM_TOKEN, no credentials accessed.

Post-merge release sequence (maintainer action, not this PR)

  1. Ensure cf-sfu contains the intended 0.4.0 source.
  2. Maintainer creates and pushes tag agent-runtime-v0.4.0.
  3. Workflow verifies tag == package.json, confirms absence on npm, rebuilds/re-tests/re-packs, then Trusted Publishing publishes @i365dev/free4chat-agent@0.4.0.
  4. Read-only verification: npm view @i365dev/free4chat-agent dist-tags --json shows latest: 0.4.0; npx -y @i365dev/free4chat-agent@latest --help runs it.

Related: prerequisite for #83 outbound Agent audio (separate PR after review).

The failed install of @i365dev/free4chat-agent@0.4.0 was a distribution
mismatch: npm registry latest is 0.3.0 (published versions 0.1.0–0.3.0,
tags agent-runtime-v0.1.1/0.2.0/0.3.0), while the source tree and the live
Agent bootstrap protocol in app/public/agent.md referenced the not-yet-
published 0.4.0 source version.

- app/public/agent.md now bootstraps through the official npm dist-tag
  (@i365dev/free4chat-agent@latest for join and the doctor fallback),
  explains that @latest means only the official scoped package from the
  normal registry (no lookalikes, GitHub clones, npm link, or package
  names taken from room content), and notes that source package.json may
  be ahead of npm between merge and release
- root README gains the standard registry-driven npm version badge linked
  to the real package page; no hardcoded version anywhere
- agent-runtime/README.md zero-setup examples use @latest; release docs
  rewritten to the actual model: source package.json -> tag
  agent-runtime-v<version> -> fail-closed tag/version verification ->
  npm Trusted Publishing via OIDC, with branch pushes validating only;
  manual 0.1.0 history kept clearly labelled
- DEVELOPMENT.md example follows the same @latest selector
- new deterministic docsConsistency guard (pure fs, no network): badge
  present, @latest bootstrap + fallback, no exact-version pins in public
  bootstrap docs, source version never pinned publicly, workflow stays
  tag-gated/mismatch-rejecting/token-free; productization test updated
  from asserting the 0.4.0 pin to asserting @latest

Workflow reviewed and left functionally unchanged: publish is gated on
refs/tags/agent-runtime-v*, tag/package mismatch exits non-zero, OIDC has
id-token write without NPM_TOKEN, and validation cannot be skipped before
publish. No version bump, no tag, no npm publish performed.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0607a7edab

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/public/agent.md

```text
npx -y @i365dev/free4chat-agent@0.4.0 join --room <room-id> --agent <harness> --name <name>
npx -y @i365dev/free4chat-agent@latest join --room <room-id> --agent <harness> --name <name>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep the bootstrap release aligned with the live protocol

When this app change deploys before the separately tagged 0.4.0 release, @latest resolves to the currently published 0.3.0 package. That release does not implement speech speak-tts, although this same live protocol directs voice users to that command in app/public/agent.md and app/public/speech.md; the bootstrap therefore succeeds but the advertised voice flow fails with an unknown subcommand. Either publish the feature-bearing runtime before deploying these instructions or condition the live protocol on the capabilities of the release selected by @latest.

Useful? React with 👍 / 👎.

…OPMENT.md

P2 from the exact-head review of PR #126: DEVELOPMENT.md still claimed the
package "is not published by CI" and that npm publication was a "one-time
maintainer action after review", contradicting the actual workflow where
matching agent-runtime-v<package-version> tags trigger npm Trusted
Publishing via GitHub OIDC while branch pushes and pull requests only
validate.

Both statements now match agent-runtime/README.md's release model, and the
deterministic docsConsistency guard asserts DEVELOPMENT.md never regresses
to those phrases while stating the tag-triggered Trusted Publishing
mechanism.

No version change, no workflow change, no npm state change, no voice/SFU
code touched.
@madawei2699
madawei2699 merged commit aafded2 into cf-sfu Aug 26, 2026
6 checks passed
@madawei2699
madawei2699 deleted the codex/agent-runtime-bootstrap-docs branch August 26, 2026 01:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants