Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
c072888
refactor(context): extract context runtime package
ScriptedAlchemy Aug 13, 2026
9e6ccd8
docs(context): use official Rstack agent plugin
ScriptedAlchemy Aug 13, 2026
ca0661c
Merge remote-tracking branch 'origin/main' into codex/rstack-mcp-obse…
ScriptedAlchemy Aug 13, 2026
b5d8c70
fix(context): keep MCP protocol output clean
ScriptedAlchemy Aug 13, 2026
f0608ee
test(context): canonicalize temporary roots
ScriptedAlchemy Aug 13, 2026
59465fe
test: support context checks on Windows
ScriptedAlchemy Aug 13, 2026
e5fe903
test: allow Windows coverage fixture time
ScriptedAlchemy Aug 13, 2026
8201b62
fix(context): compare complete snapshot evidence
ScriptedAlchemy Aug 13, 2026
5f550a4
fix(context): qualify lint snapshot freshness
ScriptedAlchemy Aug 13, 2026
a05db19
fix(context): normalize Rsdoctor module relations
ScriptedAlchemy Aug 14, 2026
8b3be60
feat(context): capture related Rstest evidence
ScriptedAlchemy Aug 14, 2026
518e89c
chore: prepare context extraction
ScriptedAlchemy Aug 14, 2026
08d8c37
refactor: import context package history
ScriptedAlchemy Aug 14, 2026
e12e172
feat: establish standalone context repository
ScriptedAlchemy Aug 14, 2026
3571e69
build: support source dependency installs
ScriptedAlchemy Aug 14, 2026
993e4f2
fix: make source installs portable
ScriptedAlchemy Aug 14, 2026
7f58090
test: assert portable coverage dependency
ScriptedAlchemy Aug 14, 2026
6c992fa
build: pin integrated Rstack tool versions
ScriptedAlchemy Aug 14, 2026
f2408b0
fix: harden context dogfood workflows
ScriptedAlchemy Aug 14, 2026
cf93f7b
test: dogfood Rsdoctor agent canary
ScriptedAlchemy Aug 14, 2026
7b24854
feat: expose focused context entry points
ScriptedAlchemy Aug 14, 2026
4dab4ab
feat: add structural Rstack context plugin
ScriptedAlchemy Aug 14, 2026
88c35a4
fix: improve degraded evidence capture
ScriptedAlchemy Aug 14, 2026
2f5062e
fix: surface Rstest capture errors
ScriptedAlchemy Aug 14, 2026
8dbb426
docs: clarify code evidence artifact inputs
ScriptedAlchemy Aug 14, 2026
a384ebc
feat: explain related test outcomes
ScriptedAlchemy Aug 14, 2026
2f30659
refactor: simplify context internals
ScriptedAlchemy Aug 14, 2026
0b89c75
feat: improve context evidence fidelity
ScriptedAlchemy Aug 14, 2026
e921c34
fix: collapse nested entry roots
ScriptedAlchemy Aug 14, 2026
c01fd3b
build: pin the Rsdoctor agent CLI canary as the dependency
ScriptedAlchemy Aug 15, 2026
50bce81
build: keep the Rsdoctor canary override root-only
ScriptedAlchemy Aug 15, 2026
291a442
build: make Rsdoctor runtime host-provided
ScriptedAlchemy Aug 15, 2026
2e7c506
fix: ignore test duration jitter in snapshot diffs
ScriptedAlchemy Aug 15, 2026
dfec1ff
fix: bind diagnostics cursors to query filters
ScriptedAlchemy Aug 15, 2026
2dba313
fix: bind lint evidence to captured paths
ScriptedAlchemy Aug 15, 2026
eba8a34
fix: reject unrelated report HTML
ScriptedAlchemy Aug 15, 2026
ff4dbfe
fix: expose truncated build counts
ScriptedAlchemy Aug 15, 2026
c4b9bff
fix: reject unreadable test snapshot inputs
ScriptedAlchemy Aug 15, 2026
d48e151
fix: preserve complete project status evidence
ScriptedAlchemy Aug 15, 2026
711b987
build: validate stacked Rsdoctor preview
ScriptedAlchemy Aug 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: CI

on:
pull_request:
push:
branches: [main]

permissions: {}

jobs:
verify:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7

- name: Enable Corepack
run: corepack enable

- name: Setup Node.js
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6
with:
node-version: 24.15.0
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Check
run: pnpm check

- name: Build
run: pnpm build

- name: Test
run: pnpm test

- name: Pack
run: |
mkdir -p .artifacts
pnpm pack --pack-destination .artifacts
50 changes: 50 additions & 0 deletions .github/workflows/pkg-pr-new.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Publish Package Previews

on:
pull_request:
branches: [main]

permissions: {}

jobs:
publish:
if: github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7

- name: Enable Corepack
run: corepack enable

- name: Setup Node.js
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6
with:
node-version: 24.15.0
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build
run: pnpm build

- name: Publish package preview
shell: bash
run: |
set +e
output=$(pnpm exec pkg-pr-new publish --pnpm --previewVersion --no-template '.' 2>&1)
status=$?
set -e
printf '%s\n' "$output"

if [ "$status" -eq 0 ]; then
exit 0
fi

if [[ "$output" == *'There is no workflow defined'* ]]; then
echo '::warning title=pkg.pr.new is not enabled::Grant the pkg.pr.new GitHub App access to rstackjs/context to publish preview packages.'
exit 0
fi

exit "$status"
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.artifacts
coverage
dist
dist-tests
node_modules
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
coverage
dist
dist-tests
pnpm-lock.yaml
4 changes: 4 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"printWidth": 100,
"singleQuote": true
}
35 changes: 35 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# AGENTS.md

## Stack

- Use the Node.js and pnpm versions declared in `package.json`.
- TypeScript package built with Rslib.
- Rsbuild APIs power build-context observation.
- Rstest runs tests and coverage.
- Rslint performs lint and type-aware checks.

## Commands

```bash
corepack enable
pnpm install
pnpm check
pnpm build
pnpm test
pnpm test:coverage
```

## Architecture

- Keep the context runtime independent of the `rstack` CLI package.
- Keep Rstack-specific command and configuration adapters in `rstackjs/rstack-cli`.
- Keep Codex and Claude plugin packaging and skills in `rstackjs/agent-skills`.
- Preserve freshness, completeness, provenance, and evidence axes independently.
- Missing Rstack producers must degrade to unavailable evidence rather than prevent other tools from
working.

## Changes

- Add tests for public API, store-schema, MCP-schema, or evidence-semantic changes.
- Keep the package API and MCP tool schemas backward compatible unless a breaking change is explicit.
- Use pkg.pr.new previews for cross-repository Rstack CLI validation.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 Rstack contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
36 changes: 34 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,34 @@
# context
Rstack project context, evidence storage, and MCP runtime.
# Rstack context

`@rstackjs/context` is the runtime behind the Rstack project-context MCP. It records and queries
checkout-local build, lint, test, coverage, and Rsdoctor evidence while keeping freshness,
completeness, and provenance explicit.

Most users install and invoke it through the `rstack` package:

```bash
rs mcp
```

The `rstack/context` export re-exports this package for programmatic consumers. Codex and Claude
Code workflow guidance is distributed separately by
[`rstackjs/agent-skills`](https://github.com/rstackjs/agent-skills).

## Development

```bash
corepack enable
pnpm install
pnpm check
pnpm build
pnpm test
```

The package uses Rslib for builds, Rstest for tests, and Rslint for lint and type-aware checks.
Rsbuild remains a public integration surface for build-context observers. See the
[context engine RFC](./docs/rfc.md) for the runtime architecture and evidence semantics.

Execution coverage evidence is optional and resolved against the package under test, not against
`@rstackjs/context` itself: install `@rstest/coverage-istanbul` (or another supported Rstest
coverage provider) as a dependency of the checkout being analyzed for coverage evidence to be
captured. `@rstackjs/context` does not declare that provider as a peer dependency.
Loading
Loading