Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>HopsuleNew to Visual Studio Code? Get it now.
Hopsule

Hopsule

Hopsule

|
2 installs
| (0) | Free
Decision-first memory system for AI teams. View and reference decisions and memories in your IDE.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Hopsule VSCode Extension

IDE integration for enforcement and context.

A Visual Studio Code extension that enforces accepted decisions inside your IDE, surfaces context packs, highlights contradictions, and requires intentional overrides. This extension serves as an enforcement surface that reflects authority from the central decision-api service—it does not create authority itself.


Table of Contents

  • Overview
  • Features
  • Architecture & Philosophy
  • Installation
  • Configuration
  • Usage
  • Development
  • Project Structure
  • Integration with decision-api
  • Limitations & Boundaries

Overview

The Hopsule VSCode Extension integrates decision-first governance directly into your development environment. It connects to the decision-api service to fetch active decisions, monitors your code for violations, and surfaces conflicts in real-time.

Key Purpose: This extension enforces accepted decisions inside the IDE. It surfaces context packs, highlights contradictions, and requires intentional overrides. It is a constraint and reminder surface, not a decision maker.


Features

🎯 In-Editor Decision Enforcement

  • Real-time Diagnostics: Code that contradicts accepted decisions is automatically highlighted with diagnostic markers (underlines)
  • Severity Levels: Violations are marked as errors, warnings, or informational messages based on conflict severity
  • Strict Mode: Optional strict mode can block violations without explicit override confirmation

📦 Context Pack Visualization

  • Load Context Packs: Import portable bundles of decisions and memories from JSON files
  • Portable Memory: Context packs can be shared across projects, teams, and time
  • Visual Tree Views: Browse decisions and conflicts in dedicated sidebar views

⚠️ Conflict Highlighting

  • Automatic Detection: Scans open files for conflicts with accepted decisions
  • Conflict Tree View: Visual representation of all detected conflicts organized by file and line
  • Decision Tree View: Browse all active decisions from the decision-api service

🔧 Commands & Actions

  • Show Active Decisions: Display all active decisions fetched from decision-api
  • Show Conflicts: Check for conflicts between current code and accepted decisions
  • Load Context Pack: Load a portable context pack (decisions + memories) from a file
  • Override Decision: Intentionally override a decision with explicit confirmation (logged to decision-api)

Architecture & Philosophy

Authority Model

This extension operates under a strict authority model:

  • decision-api is the SINGLE, CENTRAL AUTHORITY

    • Only decision-api may accept decisions
    • Only decision-api may deprecate decisions
    • Only decision-api may resolve conflicts
    • Only decision-api may mutate authoritative state
  • This extension is an enforcement surface

    • Fetches decisions from decision-api
    • Enforces accepted decisions inside the IDE
    • Surfaces contradictions
    • Requires intentional overrides (which are logged to decision-api)

Enforcement Philosophy

Enforcement is framed as remembrance, not control:

  • ✅ Correct: "You already decided this. This contradicts that decision."
  • ❌ Incorrect: "You are not allowed to do this."

The extension remembers past decisions and surfaces contradictions, requiring conscious deviation. It does not police or arbitrarily block—it reminds and requires acknowledgment.


Installation

Option 1: Debug Mode (Development)

  1. Clone the repository:

    git clone <repository-url>
    cd ide-addon
    
  2. Install dependencies:

    npm install
    
  3. Compile the extension:

    npm run compile
    
  4. Open in VS Code:

    • Open the ide-addon folder in VS Code
    • Press F5 to launch the Extension Development Host
    • A new VS Code window will open with the extension loaded

Option 2: VSIX Package (Production)

  1. Build the VSIX package:

    npm install -g vsce
    npm run compile
    vsce package
    
  2. Install the VSIX:

    • Open VS Code
    • Go to Extensions view (Ctrl+Shift+X / Cmd+Shift+X)
    • Click the ... menu → "Install from VSIX..."
    • Select the generated .vsix file

Prerequisites

  • Node.js: Version 18 or higher
  • VS Code: Version 1.80.0 or higher
  • TypeScript: Installed via npm dependencies
  • decision-api: A running instance of the decision-api service (see Configuration)

Configuration

Configure the extension in VS Code settings (settings.json):

{
  "decisionFirst.apiUrl": "http://localhost:8080",
  "decisionFirst.enabled": true,
  "decisionFirst.strictMode": false
}

Configuration Options

Setting Type Default Description
decisionFirst.apiUrl string "" Required. URL of the decision-api service (e.g., http://localhost:8080 or https://api.example.com)
decisionFirst.enabled boolean true Enable/disable decision enforcement. When disabled, the extension will not fetch decisions or check for conflicts.
decisionFirst.strictMode boolean false Strict mode: When enabled, violations are blocked without override. When disabled, violations are shown as warnings but do not prevent code changes.

Accessing Settings

  1. Via UI: File → Preferences → Settings → Search for "Decision-First"
  2. Via JSON: File → Preferences → Settings → Click the {} icon → Add configuration to settings.json

Usage

Commands

Access commands via the Command Palette (Ctrl+Shift+P / Cmd+Shift+P):

decisionFirst.showDecisions

Displays all active decisions fetched from decision-api. Decisions are shown in:

  • The Decisions tree view in the sidebar
  • The Decision-First output channel

Usage: Open Command Palette → Type "Show Active Decisions" → Press Enter

decisionFirst.showConflicts

Checks for conflicts between current code and accepted decisions. Conflicts are displayed in:

  • The Conflicts tree view in the sidebar
  • Diagnostic markers (underlines) in the editor
  • The Decision-First output channel

Usage: Open Command Palette → Type "Show Conflicts" → Press Enter

decisionFirst.loadContextPack

Loads a portable context pack (decisions + memories) from a JSON file. A file picker dialog will open to select the context pack file.

Usage: Open Command Palette → Type "Load Context Pack" → Press Enter → Select JSON file

decisionFirst.overrideDecision

Intentionally override a decision. This command:

  • Shows a modal warning requiring explicit confirmation
  • Logs the override to decision-api
  • Allows temporary override (until next session, if implemented)

Usage: Open Command Palette → Type "Override Decision" → Press Enter → Confirm override

Views

The extension provides two tree views in the Explorer sidebar:

Decisions View

  • Location: Explorer sidebar → "Decisions" section
  • Content: Tree view of all active decisions from decision-api
  • Actions: Click a decision to view details in tooltip
  • Refresh: Automatically refreshes when decisions are fetched

Conflicts View

  • Location: Explorer sidebar → "Conflicts" section
  • Content: Tree view of detected conflicts organized by file and line
  • Format: filePath:line with conflict message as description
  • Actions: Click a conflict to navigate to the file and line

Diagnostics

The extension provides real-time diagnostics for code that contradicts accepted decisions:

  • Visual Indicators: Underlines in the editor (red for errors, yellow for warnings, blue for info)
  • Hover Details: Hover over underlined code to see the conflict message and decision ID
  • Problems Panel: All conflicts appear in VS Code's Problems panel (Ctrl+Shift+M / Cmd+Shift+M)

Output Channel

All extension activity is logged to the Decision-First output channel:

  • Access: View → Output → Select "Decision-First" from the dropdown
  • Content: Command execution logs, API requests, error messages, override confirmations

Development

Prerequisites

  • Node.js 18+
  • VS Code 1.80.0+
  • TypeScript 5.0+
  • A running decision-api instance for testing

Setup

  1. Clone and install:

    git clone <repository-url>
    cd ide-addon
    npm install
    
  2. Compile:

    npm run compile
    
  3. Watch mode (auto-compile on changes):

    npm run watch
    
  4. Run in debug mode:

    • Open the ide-addon folder in VS Code
    • Press F5 or go to Run → Start Debugging
    • A new Extension Development Host window will open
    • The extension will be active in this window

Debugging

  • Breakpoints: Set breakpoints in .ts files in the src/ directory
  • Debug Console: View logs and errors in the Debug Console (View → Debug Console)
  • Output Channel: Monitor extension output in the "Decision-First" output channel
  • Extension Host Logs: Check VS Code Developer Tools (Help → Toggle Developer Tools)

Scripts

Script Description
npm run compile Compile TypeScript to JavaScript (outputs to out/ directory)
npm run watch Watch mode: automatically recompile on file changes
npm run lint Run ESLint on source files
npm run vscode:prepublish Prepare extension for publishing (runs compile)

Project Structure

ide-addon/
├── package.json              # VS Code extension manifest (commands, views, configuration)
├── tsconfig.json             # TypeScript configuration
├── .vscodeignore            # Files excluded from extension package
├── .gitignore               # Git ignore patterns
├── src/
│   ├── extension.ts         # Main entry point (activate/deactivate hooks)
│   ├── commands/            # Command handlers
│   │   ├── index.ts         # Command exports
│   │   ├── showDecisions.ts # Show active decisions command
│   │   ├── showConflicts.ts # Show conflicts command
│   │   ├── loadContextPack.ts # Load context pack command
│   │   └── overrideDecision.ts # Override decision command
│   ├── providers/           # Tree views and diagnostics providers
│   │   ├── index.ts         # Provider exports
│   │   ├── decisionsProvider.ts # Tree view for decisions
│   │   ├── conflictsProvider.ts # Tree view for conflicts
│   │   └── diagnosticsProvider.ts # Diagnostics provider for violations
│   └── types/               # TypeScript type definitions
│       └── index.ts         # Decision, Conflict, ContextPack, Memory types
└── README.md                # This file

Building for Production

  1. Compile:

    npm run compile
    
  2. Package (requires vsce):

    npm install -g vsce
    vsce package
    
  3. Output: A .vsix file will be created in the project root


Integration with decision-api

This extension connects to decision-api to:

  • Fetch active decisions: Retrieves all ACCEPTED decisions for enforcement
  • Check for conflicts: Sends code snippets to decision-api for conflict detection
  • Log overrides: Records intentional decision overrides for audit purposes
  • Load context packs: Validates and applies context packs through decision-api

API Endpoints Used

The extension communicates with decision-api using standard HTTP requests:

  • GET {apiUrl}/decisions?status=ACCEPTED - Fetch active decisions
  • POST {apiUrl}/conflicts/check - Check code for conflicts (when implemented)
  • POST {apiUrl}/overrides - Log decision overrides (when implemented)
  • POST {apiUrl}/context-packs/load - Load context pack (when implemented)

Important Notes

  • This extension never mutates authoritative state. All state changes go through decision-api.
  • This extension does not create decisions. It only enforces existing accepted decisions.
  • Network errors are handled gracefully. If decision-api is unavailable, the extension will show appropriate warnings but will not crash.

Limitations & Boundaries

What This Extension DOES

✅ Fetches decisions from decision-api
✅ Enforces accepted decisions inside the IDE
✅ Surfaces contradictions as diagnostics
✅ Requires intentional overrides
✅ Displays decisions and conflicts in tree views
✅ Loads context packs from files

What This Extension DOES NOT Do

❌ Does NOT own data — All decisions come from decision-api
❌ Does NOT decide anything — Only decision-api can accept or deprecate decisions
❌ Does NOT create authority — It reflects authority, it does not create it
❌ Is NOT an assistant — It is a constraint and reminder surface
❌ Is NOT a helper — It enforces, it does not assist
❌ Does NOT resolve conflicts — Conflict resolution happens in decision-api
❌ Does NOT mutate state — All state changes go through decision-api

Architectural Constraints

This extension is designed to be strictly advisory and enforcement-focused. It:

  • Never makes autonomous decisions
  • Never creates or modifies decisions
  • Never resolves conflicts independently
  • Always defers to decision-api for authority

If you need to create, modify, or deprecate decisions, use the decision-api service directly or through the web application.


Contributing

When contributing to this extension, remember:

  • This extension is an enforcement surface, not a decision maker
  • All decisions come from decision-api
  • Enforcement is remembrance, not control
  • Language matters — avoid framing that suggests this extension creates authority

Follow the architectural principles outlined in the main project rules. This extension must maintain its identity as a constraint and reminder surface.


License

[To be determined]


Support

For issues, questions, or contributions:

  • Issues: Report bugs or request features via the project's issue tracker
  • Documentation: See the main project README for system-wide architecture
  • decision-api: Ensure decision-api is running and accessible before using this extension

Remember: This extension enforces accepted decisions—it does not create them. All authority resides in decision-api.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft