Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
# Retrieval corpus tests read files from a pinned earlier commit.
fetch-depth: 0
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 22
Expand Down
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,10 @@ Open TrueForge at `http://127.0.0.1:8790` and add a model under **Settings → M
- **Instructions.** Set **AgentExtension: User Instructions** to add standing preferences to every run. To use repository instructions, add `.agentextension/instructions.md`, `AGENTS.md`, or path rules in `.agentextension/rules/`. Then select **Instructions** and approve them. Any change to those files requires a new approval.
- **Permission rules.** Select **Permission rules** to see the administrator, user, and workspace rules that apply. Add or remove workspace rules there. When you approve a command, choose **Always allow in this workspace** to save an exact allow rule for that command.
- **Scheduled reports.** Select **Scheduled reports** in the panel or run **AgentExtension: Manage Scheduled Reports**. Choose the request, timing, budget, and any optional connectors or context. Review the scope and select **Approve schedule**. Runs are read-only. You can approve the local runner to run a schedule when VS Code is closed. [Schedule setup](#scheduled-reports)
- **Usage and budget.** The panel shows the tokens, tool calls, and time a run has used. Tokens include worker sessions and context compaction. **AgentExtension: Run Budget** sets the limits. The defaults are 1,000,000 tokens, 30 minutes, and 200 tool calls. After a limit is reached, every tool except `review_changes` is refused, so staged work can still be reviewed. At 125% of the token or time limit, the run is cancelled.
- **Usage and budget.** The panel shows the tokens, tool calls, and time a run has used. Tokens include worker sessions and context compaction. **AgentExtension: Run Budget** sets the limits. The defaults are 1,000,000 tokens, 30 minutes, and 200 tool calls. The agent receives the limits and bounded progress notices while it works. After a limit is reached, every tool except `review_changes` is refused, so staged work can still be reviewed. At 125% of the token or time limit, the run is cancelled.
- **Audit export.** Select **Export audit log** to save a redacted JSON export of this workspace's permission decisions and run summaries. In an enrolled workspace, use **AgentExtension: Sync Organization Audit** to upload retained events and view the last result. [Organization setup](#organization-policy-and-audit)
- **Saved reports.** Select **Open saved run report** to open the latest report. After a restart, choose a saved report for the workspace. Reports link to exact checked draft patches, worker sessions, and requested browser screenshots. They separate passed, failed, skipped, and stale checks. The extension retains the latest 20 report folders per workspace.
- **Completion checks.** If the agent stops with an unchecked draft, the host asks it once to finish missing work and check the draft. Commands still need approval. The panel shows when verification is incomplete. An empty response gets at most one continuation. A promise to do work without a draft gets one follow-up that preserves planning-only and no-edit requests. External writes prevent these automatic continuations. These checks do not prove that all requested behavior works.
- **Saved reports.** Select **Open saved run report** to open the latest report. After a restart, choose a saved report for the workspace. Reports link to exact checked draft patches, task state, tool timing, worker sessions, and requested browser screenshots. Progress records separate active work from waits for user input. Repeated reads and rejected tools are observed signals, not proven causes. They separate passed, failed, skipped, diagnostic-only, and stale checks. Empty interpreters, version probes, and help output are diagnostic only. The extension retains the latest 20 report folders per workspace.

Direct skill and connector selections last for the current extension-host session. Select them again after a restart. Workspace notes, exact plugin approvals, and approved schedules persist. A restart restores no one-time tool approvals. Changing skill roots, plugin roots, connector settings, or connector credentials cancels an active run.

Expand Down Expand Up @@ -543,7 +544,11 @@ TrueForge owns the agent loop, model calls, tool discovery, and approval pauses.

Run start grants workspace reads and in-memory draft proposals. Plans, reviews, commands, connector calls, apply, and undo use exact host-issued approvals. One-time grants bind the canonical workspace, run, policy, tool, normalized arguments, target, and scope. Commands also bind the draft revision and hunk selection. Grants expire after five minutes. Dispatch consumes them once. Denial and revocation take precedence. Retry clears pending approvals. Model summaries cannot restore them.

The context pass ranks overlapping code windows with prompt keywords, rare terms, and path matches. Explicit mentions come first. VS Code's language services can add definitions and references for explicit symbols, the active editor symbol when it matches the request, and a selected diagnostic. Provider results stay within the approved workspace and the same excerpt budget. Keyword search supplies context when a provider returns no results. Agent mode reserves candidates for implementation, tests, and documentation. The panel shows selected paths, line ranges, and reasons. Retrieved excerpts have a 12,000-character budget in agent mode and a 4,000-character budget in inline mode. The request and the inline selection are separate from that budget. Each file read returns up to 5,000 characters of exact source text. A worker ranks excerpts and handles workspace searches. TrueForge preloads the search, read, proposal, review, and command tools, plus `suggest_note` and enabled worker tools. It defers the remaining tool schemas and can compact long turn histories.
The context pass uses identifier-aware BM25 ranking with path and exact-symbol matches. It packs bounded declaration and line excerpts without overlapping windows. Explicit mentions come first. VS Code's language services can add document and workspace symbols, definitions, and references. Provider results stay within the approved workspace and the excerpt budget. Text retrieval remains available when a provider is missing or slow. Agent mode reserves candidates for implementation, tests, and documentation. The panel shows selected paths, line ranges, and reasons. Retrieved excerpts use at most 12,000 characters in agent mode and 4,000 in inline mode. A smaller declared model context reduces that budget. Token counts are estimates. The request and inline selection use separate space. Each file read returns up to 5,000 characters of exact source text. A worker ranks initial excerpts.

Workspace search reads current disk files and overlays unsaved buffers and staged drafts. It supports literal, word, path, glob-filtered, and keyword queries. Bounded regex search is available when a supported ripgrep executable is found. Search returns source digests, page cursors, and coverage limits. A changed result set invalidates its cursor. Related-file lookup returns separately labelled import, test-name, and documentation hints. Search hints do not grant edit access; line edits still need current read receipts.

A private, rebuildable index reuses unchanged disk text between runs. It reconciles the file inventory, file metadata, and Git revision on each snapshot. Dirty buffer text stays in memory. The context details show indexed and unindexed counts. Use **AgentExtension: Clear Source Index** to remove the cache before the next run. The agent can batch up to four known excerpts with `read_files`. A batch returns at most 12,000 source characters and a separate edit receipt for each returned excerpt. Private-path exclusions and repeated-read limits still apply. Semantic retrieval is an evaluation-only experiment and is disabled in normal search. TrueForge preloads the search, read, proposal, review, and command tools, plus `suggest_note` and enabled worker tools. It defers the remaining tool schemas and can compact long turn histories.

Proposals stage exact-text replacements or line ranges in memory. A line proposal must use a recent read of that range. It can target a unique source line from the excerpt. A change to the same file invalidates the read. Inline edits are restricted to the original selection. Plan-first runs require plan approval before draft edits or commands. A separate TrueForge approval opens hunk review. Only the current reviewed revision can be applied. The extension checks the original text again before it applies the edits.

Expand All @@ -555,7 +560,7 @@ On an eligible model error the extension clears editor drafts and tries the conf

- `npm run check` checks JavaScript syntax, checks types for permissions, policy, draft edits, and apply, and lints for unhandled promises in those modules and the schedule controller. Run `npm run typecheck` or `npm run lint` to run either check on its own. GitHub Actions runs the checks, tests, and VSIX build on Node.js 22.
- `npm test` checks context, edit scoping, hunk offsets, workspace boundaries, plugin pins, worker limits, schedule time zones, offline catch-up, and schedule storage. Without a test server, integration cases are skipped.
- `npm run test:qwen` runs seven scenarios against a real model through a running TrueForge server. The scenarios are edit and check, a question, a suggested note, instructions with a path rule, the fix workers, budget and audit, and a scheduled report. By default, it uses `local-lm-studio/qwen` at `http://127.0.0.1:8790`. If that provider is missing, it registers it from `trueforge/model.example.json`. It uses the model ID LM Studio lists, or a served Qwen 9B if the example ID is missing. Set `AGENTEXTENSION_TEST_MODEL`, `AGENTEXTENSION_TEST_MODEL_ID`, and `AGENTEXTENSION_TEST_FORGE_URL` to use other values. On macOS, double-click `scripts/test-qwen.command` to start TrueForge if needed, run the scenarios, and stop it afterwards. Set `AGENTEXTENSION_TEST_RESULTS_DIR` to write results outside `test-results`. Use `-- --only fix-team-workers` to check the worker merge and hunk review separately. Each scenario reports required and optional checks.
- `npm run test:qwen` runs seven scenarios against a real model through a running TrueForge server. The scenarios are edit and check, a question, a suggested note, instructions with a path rule, the fix workers, budget and audit, and a scheduled report. By default, it uses `local-lm-studio/qwen` at `http://127.0.0.1:8790`. If that provider is missing, it registers it from `trueforge/model.example.json`. It uses the model ID LM Studio lists, or a served Qwen 9B if the example ID is missing. Set `AGENTEXTENSION_TEST_MODEL`, `AGENTEXTENSION_TEST_MODEL_ID`, and `AGENTEXTENSION_TEST_FORGE_URL` to use other values. On macOS, double-click `scripts/test-qwen.command` to start TrueForge if needed, run the scenarios, and stop it afterwards. Set `AGENTEXTENSION_TEST_RESULTS_DIR` to write results outside `test-results`. Use `-- --only fix-team-workers` to check the worker merge and hunk review separately. Task requirements are mandatory. Only a complete outcome passes. Coding tasks must reach review, apply in a disposable copy, and pass independent acceptance checks. Missing model connections are recorded as environment-unavailable and fail the command. Run `npm run test:scoring` to test the scorer without a model. [Scoring contract](test/model/README.md)
- Set `AGENTEXTENSION_TEST_BROWSER` to a Chrome or Chromium executable to run the real-browser tests with `AGENTEXTENSION_TEST_SURFACES=1`. On Linux, use Xvfb and a non-root user, because Chromium's sandbox does not run as root. The native-app test runs only on macOS.
- The `test/extension-*.test.js` files load the extension in a stubbed VS Code host from `test/helpers/host.cjs` and drive it through webview messages and scripted dialogs. Most need the test server.
- With the test server set, `test/extension-schedules.test.js` loads the extension in a stubbed VS Code host. It creates and approves a schedule through the real commands. It waits for the extension timer to run the schedule through TrueForge, then checks the saved report and history. It also checks reapproval after a credential change.
Expand All @@ -569,4 +574,4 @@ On an eligible model error the extension clears editor drafts and tries the conf

The post-implementation run used Node.js 24.18.0, VS Code 1.146.0, and TrueForge 0.184.2 on Apple silicon macOS. The integration suite uses real TrueForge sessions and a scripted model endpoint. The targeted Qwen runs report model behavior separately. [Verification record](docs/milestones.md#post-implementation-verification) · [Remaining work](docs/remaining-work.md)

The extension caps each keyword index pass at 12,000 candidate paths and 32 million characters. The same limits affect initial retrieval and search. Isolated commands run on macOS or on Linux with bubblewrap.
Initial indexing covers up to 20,000 permitted paths and 256 MB of source, with a 4.5-second preparation deadline. Fresh search has a 2-second deadline, a 20,000-path limit, a 256 MB byte budget, and at most 1,024 matches before paging. Both paths report incomplete coverage when a limit is reached. Files over 256 KB, hidden/private paths, and binary content remain excluded. Isolated command snapshots still use the existing 12,000-path and 64 MB limits. Isolated commands run on macOS or on Linux with bubblewrap.
Loading
Loading