chore(release): v0.1.0-preview.0 (published to npm)#13
Conversation
Package metadata: - bump version to 0.1.0-preview.0 - add files whitelist (dist, README, LICENSE) so internal paths, examples, and docs stay out of the tarball - add repository / homepage / bugs / keywords / author for a non-embarrassing npmjs.com landing page - add publishConfig with access: public and tag: preview so the preview release does not claim @latest - add prepublishOnly hook that runs typecheck + tests + build - split build into tsconfig.build.json that excludes *.test.ts so test files do not ship in the tarball README: - add a Status: Preview banner calling out the unfrozen API and the install command (`npm install tegata@preview`) Verified via `npm pack` + install in a scratch project: both the root export and the `tegata/mcp` subpath resolve, `propose()` returns a decision, and `TegataServer` constructs cleanly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThe PR marks the project as a preview release, updates package metadata and publish settings, changes the build script to use a new TypeScript build config, and adds Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Code Review
This pull request prepares the project for its initial preview release by updating the versioning to v0.1.0-preview.0, adding comprehensive package metadata to package.json, and refining the build and publication scripts. A new tsconfig.build.json has been introduced to handle production builds. Feedback focuses on improving the reliability of the release process by cleaning the build directory before compilation, ensuring linting is part of the pre-publish hook, and disabling source maps in the production build to prevent broken references for package consumers.
| }, | ||
| "scripts": { | ||
| "build": "tsc", | ||
| "build": "tsc -p tsconfig.build.json", |
There was a problem hiding this comment.
The build script does not clean the dist directory before compiling. This can lead to stale or "ghost" files (from previous builds or deleted source files) being included in the published package. It is recommended to add a clean step to ensure a fresh build for every release.
| "build": "tsc -p tsconfig.build.json", | |
| "build": "rm -rf dist && tsc -p tsconfig.build.json", |
There was a problem hiding this comment.
Fixed in 7a8d343. build now runs rm -rf dist && tsc -p tsconfig.build.json. Noted that 0.1.0-preview.0 on npm is immutable, so this first takes effect on the next preview publish.
| "lint": "prettier --check . && eslint .", | ||
| "format": "prettier --write ." | ||
| "format": "prettier --write .", | ||
| "prepublishOnly": "pnpm run typecheck && pnpm run test && pnpm run build" |
There was a problem hiding this comment.
It is recommended to include the lint script in the prepublishOnly hook. This ensures that only code adhering to the project's style and quality rules is published to npm, preventing accidental releases of unformatted or lint-violating code.
| "prepublishOnly": "pnpm run typecheck && pnpm run test && pnpm run build" | |
| "prepublishOnly": "pnpm run lint && pnpm run typecheck && pnpm run test && pnpm run build" |
There was a problem hiding this comment.
Fixed in 7a8d343. prepublishOnly now runs lint && typecheck && test && build.
| { | ||
| "extends": "./tsconfig.json", | ||
| "exclude": ["node_modules", "dist", "**/*.test.ts"] | ||
| } |
There was a problem hiding this comment.
The production build inherits sourceMap: true and declarationMap: true from the base tsconfig.json, but the src directory is excluded from the npm package (via package.json#files). This results in broken source maps for consumers, as the mapped .ts files will be missing in the installed package. You should either disable maps in this build configuration or include the src directory in the package.
| { | |
| "extends": "./tsconfig.json", | |
| "exclude": ["node_modules", "dist", "**/*.test.ts"] | |
| } | |
| { | |
| "extends": "./tsconfig.json", | |
| "compilerOptions": { | |
| "sourceMap": false, | |
| "declarationMap": false | |
| }, | |
| "exclude": ["node_modules", "dist", "**/*.test.ts"] | |
| } |
There was a problem hiding this comment.
Good catch — fixed in 7a8d343. tsconfig.build.json now sets sourceMap: false and declarationMap: false. Adding src/ to the package was the other option, but shipping only compiled output keeps the tarball small and matches what most SDK consumers expect. Tarball went from 39 files / 25.7 kB to 21 files / ~14 kB as a side effect.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@README.md`:
- Line 5: Update the preview banner version to the exact prerelease string used
by the package: replace "v0.1.0-preview" with "0.1.0-preview.0" (and update the
install instruction `npm install tegata@preview` to `npm install
tegata@0.1.0-preview.0` if you want the exact pinned install) so the README's
status line and install example match the package's actual prerelease version.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: df4cc304-2db1-4fce-acd4-2fa1e22d36f5
📒 Files selected for processing (3)
README.mdpackage.jsontsconfig.build.json
|
|
||
| **Enforceable authorization for MCP tool calls.** | ||
|
|
||
| > **Status: Preview (v0.1.0-preview).** Core runtime, policy engine, and MCP tool call intercept are working and tested. The API is **not frozen** until the v0.1.0 GA release — breaking changes may ship in subsequent preview versions. Trust Score and Consensus policies beyond `single`/`majority` are specified but not yet implemented. Install with `npm install tegata@preview`. |
There was a problem hiding this comment.
Use the exact prerelease version string in the preview banner.
Line [5] says v0.1.0-preview, while the package version is 0.1.0-preview.0. Matching the exact version avoids ambiguity.
✏️ Suggested doc fix
-> **Status: Preview (v0.1.0-preview).** Core runtime, policy engine, and MCP tool call intercept are working and tested. The API is **not frozen** until the v0.1.0 GA release — breaking changes may ship in subsequent preview versions. Trust Score and Consensus policies beyond `single`/`majority` are specified but not yet implemented. Install with `npm install tegata@preview`.
+> **Status: Preview (v0.1.0-preview.0).** Core runtime, policy engine, and MCP tool call intercept are working and tested. The API is **not frozen** until the v0.1.0 GA release — breaking changes may ship in subsequent preview versions. Trust Score and Consensus policies beyond `single`/`majority` are specified but not yet implemented. Install with `npm install tegata@preview`.📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| > **Status: Preview (v0.1.0-preview).** Core runtime, policy engine, and MCP tool call intercept are working and tested. The API is **not frozen** until the v0.1.0 GA release — breaking changes may ship in subsequent preview versions. Trust Score and Consensus policies beyond `single`/`majority` are specified but not yet implemented. Install with `npm install tegata@preview`. | |
| > **Status: Preview (v0.1.0-preview.0).** Core runtime, policy engine, and MCP tool call intercept are working and tested. The API is **not frozen** until the v0.1.0 GA release — breaking changes may ship in subsequent preview versions. Trust Score and Consensus policies beyond `single`/`majority` are specified but not yet implemented. Install with `npm install tegata@preview`. |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@README.md` at line 5, Update the preview banner version to the exact
prerelease string used by the package: replace "v0.1.0-preview" with
"0.1.0-preview.0" (and update the install instruction `npm install
tegata@preview` to `npm install tegata@0.1.0-preview.0` if you want the exact
pinned install) so the README's status line and install example match the
package's actual prerelease version.
There was a problem hiding this comment.
Intentionally keeping v0.1.0-preview (series-level) rather than 0.1.0-preview.0 (pinned) in the banner. The banner is meant to describe the preview line as a whole — preview.1, preview.2, etc. will all ship under the same README text, and I do not want to bump the README every time I cut a prerelease. The exact version is one npm-view away for anyone who wants it, and the install command (npm install tegata@preview) already resolves to whatever the current preview head is. Not applying this one.
There was a problem hiding this comment.
@renasami, understood — using the series-level label v0.1.0-preview intentionally so the banner stays stable across all preview increments is a sensible doc strategy. The npm install tegata@preview tag already handles version resolution dynamically. I'll drop this suggestion.
✏️ Learnings added
Learnt from: renasami
Repo: renasami/tegata PR: 13
File: README.md:5-5
Timestamp: 2026-04-18T18:48:09.954Z
Learning: In `README.md` (Tegata project), the preview banner intentionally uses the series-level string `v0.1.0-preview` rather than a pinned prerelease like `0.1.0-preview.0`. This is by design so the README does not need to be updated for each prerelease cut (preview.0, preview.1, etc.). The `npm install tegatapreview` dist-tag resolves to the current preview head dynamically.
Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.
🧠 Learnings used
Learnt from: CR
Repo: renasami/tegata PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-14T16:49:36.018Z
Learning: Tegata v0.1 scope is Agent→Tool authorization (MCP tool call intercept) ONLY — do NOT implement Agent↔Agent features (planned for v0.3)
Learnt from: renasami
Repo: renasami/tegata PR: 10
File: src/bindings/mcp/tegata-server.ts:190-195
Timestamp: 2026-04-16T17:34:39.259Z
Learning: In `src/bindings/mcp/tegata-server.ts` (Tegata project, TypeScript), the cast of `toolConfig as ToolConfig<undefined>` and `wrappedHandler as ToolCallback` when calling `this.mcp.registerTool(...)` is intentional and correct at the MCP SDK boundary. TypeScript generics are erased at runtime; the MCP SDK validates using the actual `inputSchema` value, not the generic type parameter. The cast is necessary to satisfy TypeScript's type checker at the boundary and does not affect runtime behavior.
Learnt from: renasami
Repo: renasami/tegata PR: 7
File: src/core/runtime.ts:186-236
Timestamp: 2026-04-14T17:34:05.295Z
Learning: In `src/core/runtime.ts` (Tegata runtime, TypeScript), unregistered proposers intentionally bypass the agent capability and `maxApprovableRisk` checks in `propose()`. This is by design to honour the zero-config guarantee (`new Tegata()` + unregistered proposer must work). The test "unregistered proposer skips capability check (zero-config)" explicitly validates this behaviour. An opt-in `requireRegisteredProposer` control is planned for v0.2.
- build: prefix `rm -rf dist` so tsc does not leave stale files from previous compilations in the tarball. - prepublishOnly: run `lint` before typecheck/test/build so prettier and eslint violations cannot slip into a published release. - tsconfig.build: disable `sourceMap` and `declarationMap`. The package does not ship `src/`, so source maps were pointing at `.ts` files that do not exist in the consumer's node_modules — that is broken maps, not helpful ones. Shrinks the tarball from 39 files (25.7 kB) to 21 files (~14 kB) as a side effect. Will be reflected in the next preview publish; 0.1.0-preview.0 is immutable on npm. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Review response (7a8d343)
Important caveat: |
Summary
Prepares the repo state that produced tegata@0.1.0-preview.0 on npm. Already published — this PR just records the release prep in git.
What changed
version:0.1.0-preview.0files:["dist", "README.md", "LICENSE"](previously unset — examples/, docs/, CLAUDE.md would have shipped)repository/homepage/bugs/keywords/authorfor the npmjs.com landing pagepublishConfig:access: "public",tag: "preview"prepublishOnly:typecheck && test && buildauthor:Ren Asami <60680416+renasami@users.noreply.github.com>**/*.test.ts, so test files are not shipped in the published tarball.pnpm run buildnow points to this.Status: Previewbanner calling out the unfrozen API + thenpm install tegata@previewcommand.Validation
pnpm run typecheck/pnpm run test(90 tests) /pnpm run lint— all passnpm pack→ install in scratch project — bothtegataandtegata/mcpsubpaths resolve,propose()returns a decision,TegataServerconstructs cleanlyFollow-ups (not in this PR)
latestdist-tag so onlytegata@previewresolvesTegataServer🤖 Generated with Claude Code
Summary by CodeRabbit
Documentation
Chores