Skip to content

feat: transparent thin-client reconnection (CRW-13910) - #412

Closed
adietish wants to merge 11 commits into
mainfrom
CRW-13910
Closed

adietish wants to merge 11 commits into
mainfrom
CRW-13910

Conversation

@adietish

Copy link
Copy Markdown
Collaborator

What

The JetBrains Client (thin client / Guest) reconnects transparently after a transient outage (network cut, VPN drop, sleep/resume, pod replacement): the window stays open and the session re-dials in place. No client relaunch, no new window, no new local port. If the workspace does not come back within the recovery budget, an error dialog is shown.

How (layered, one commit each)

Commit Layer
steady-state port-forward retries An established session keeps retrying failed handshakes while the client socket is alive and the pod is not gone (backoff 1–5 s, 10-min outage budget). Connect-time keeps the 3-attempt fast-fail so the wizard does not hang.
select running ready pod DevWorkspacePods.findFirstRunning: skip terminating, require Running + Ready, prefer the newest — the first list item can be the dying pod during a roll.
join-link helper and forward probe ThinClientJoinLink (:5990 → local-port rewrite, reconnect nonce fragment param) and PortForwarder.probe (bounded open-and-close that proves the whole forward path).
transparent thin-client recovery watcher On remote-end loss, a bounded watcher resolves the current workspace pod, probes it, then prods the open Guest via ThinClientHandle.updateJoinLink(uri, forceReconnect = true) — verified from the decompiled Guest to drop the RD link and re-dial it, keeping the window open. Recovery is confirmed by real dial outcomes, never by the send ack. A link is refreshed only when every dial since the prod failed fast.
retarget port forward to replacement pod On POD_GONE with the DevWorkspace still Running, the forward swaps to the replacement pod (idempotent, lock-guarded); the attempt series restarts but the outage budget keeps running.

Notable behavior decisions

  • Recovery is transparent only: nothing relaunches or closes the client; the last resort is an error dialog.
  • Guest closed mid-recovery no longer auto-stops the workspace — tearDownConnection withholds the remote stop() while the recovery watcher is running; the failure dialog owns that decision. The healthy-path close⇒stop contract is unchanged.
  • RemoteIDEServer swaps pod and IDE container as one atomic target, and the idea-server container predicate now requires the named port — the old ports?.any { … } != null matched any container with a non-null ports list, so ServerContainerNotFoundException could never fire.

Testing

801 tests, 0 failures. New suites: ForwardRetryPolicyTest, ThinClientJoinLinkTest, ThinClientRecoveryWatcherTest; extended PodPortForwarderTest, DevWorkspacePodsTest, RemoteIDEServerTest, DevSpacesConnectionTest. ./gradlew detekt stays at the pre-existing baseline (no new findings).

Outstanding

Live validation against a real DevWorkspace (prod delivery into a dead-but-open Guest, same-link no-op guard, Guest websocket survival time, dial-pattern threshold for the 2 s fast-fail window) before flipping out of draft.

A live session keeps retrying failed handshakes while the
client socket is alive and the pod is not gone, backing off
1s..5s within a 10min outage budget. Connect-time keeps the
3-attempt fast-fail so the wizard does not hang.

Signed-off-by: Andre Dietisheim <adietish@redhat.com>
First list item can be the terminating pod during a pod roll,
pinning status execs and port-forwards to a pod that no longer
serves. Prefer the newest Running+Ready pod instead.

Signed-off-by: Andre Dietisheim <adietish@redhat.com>
Extract the :5990 -> local-port rewrite so reconnect can reuse
it; add a nonce fragment param to defeat the Guest's same-link
no-op guard. Add PortForwarder.probe: bounded open-and-close
that proves the whole forward path without a client socket.

Signed-off-by: Andre Dietisheim <adietish@redhat.com>
When the forward's remote end dies, a bounded watcher probes the
workspace-scoped pod, then prods the open Guest via
updateJoinLink(forceReconnect): the window stays open, the RD link
re-dials. Stale links (only fast-failed dials) are refreshed;
recovery is read from real dial outcomes, never from the send ack.
Guest closed mid-recovery no longer auto-stops the workspace.

Signed-off-by: Andre Dietisheim <adietish@redhat.com>
A pod replaced while the DevWorkspace stays running no longer
kills the forward: on POD_GONE the forwarder resolves the
current running+ready pod and swaps it in idempotently under a
lock; the attempt series restarts but the steady-state outage
budget keeps running. RemoteIDEServer swaps pod and IDE
container as one atomic target, and the idea-server container
predicate now actually requires the named port.

Signed-off-by: Andre Dietisheim <adietish@redhat.com>
@coderabbitai

coderabbitai Bot commented Nov 18, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

🤖 AgentReady Assessment Report

Repository: devspaces-gateway-plugin
Path: /home/runner/work/devspaces-gateway-plugin/devspaces-gateway-plugin
Branch: HEAD | Commit: 8d350008
Assessed: November 19, 2026 at 8:31 PM
AgentReady Version: 2.52.3
Run by: runner@runnervmccnms


📊 Summary

Metric Value
Overall Score 46.6/100 🥉 Bronze (Tier Definitions)
Attributes Assessed 17/34
Attributes Not Assessed 17
Assessment Duration 0.6s

Languages Detected

  • Kotlin: 222 files
  • Markdown: 10 files
  • YAML: 9 files
  • XML: 7 files

Repository Stats

  • Total Files: 297
  • Total Lines: 40,001

🎯 Priority Improvements

Focus on these high-impact fixes first:

  1. Single-File Verification (Tier 1) - +5.0 points potential
    • Document single-file lint and type-check commands in CLAUDE.md/AGENTS.md
  2. Dependency Pinning for Reproducibility (Tier 1) - +5.0 points potential
    • Add lock file for dependency reproducibility
  3. Standard Project Layouts (Tier 1) - +5.0 points potential
    • Organize code into standard directories
  4. CI Quality Gates (Tier 1) - +5.0 points potential
    • Add or improve CI/CD pipeline configuration
  5. Conventional Commit Messages (Tier 2) - +3.0 points potential
    • Configure conventional commits with commitlint

📋 Detailed Findings

Findings sorted by priority (Tier 1 failures first, then Tier 2, etc.)

T1 Single-File Verification ❌ 0/100

📝 Remediation Steps

Measured: not documented (Threshold: single-file lint + type-check commands documented)

Evidence:

  • No single-file verification commands found in context files

Document single-file lint and type-check commands in CLAUDE.md/AGENTS.md

  1. Add single-file lint command to context file (e.g., 'ruff check path/to/file.py')
  2. Add single-file type-check command (e.g., 'mypy path/to/file.py')
  3. Ensure these commands work without a full build step
  4. Target <5 seconds execution per file

Commands:

# Python
ruff check path/to/file.py
mypy path/to/file.py

# JavaScript/TypeScript
npx eslint path/to/file.ts
npx tsc --noEmit path/to/file.ts

# Go
golangci-lint run path/to/file.go
go vet path/to/file.go

# YAML / Shell
yamllint path/to/file.yaml
shellcheck path/to/script.sh
bash -n path/to/script.sh

T1 Dependency Pinning for Reproducibility ❌ 0/100

📝 Remediation Steps

Measured: none (Threshold: lock file with pinned versions)

Evidence:

  • No dependency lock files found

Add lock file for dependency reproducibility

  1. For Go: run 'go mod tidy' (generates go.sum)
  2. For npm: run 'npm install' (generates package-lock.json)
  3. For Python: use 'pip freeze > requirements.txt' or poetry
  4. For Ruby: run 'bundle install' (generates Gemfile.lock)
  5. For Terraform: run 'terraform providers lock' (generates .terraform.lock.hcl)

Commands:

go mod tidy  # Go
npm install  # npm
pip freeze > requirements.txt  # Python
poetry lock  # Python with Poetry
terraform providers lock  # Terraform

T1 Standard Project Layouts ❌ 50/100

📝 Remediation Steps

Measured: 1/2 directories (Threshold: 2/2 directories)

Evidence:

  • Found 1/2 standard directories
  • src/: ✓
  • tests/: ✗
  • Naming consistency: ✓ (consistent conventions)

Organize code into standard directories

  1. Create tests/ directory for test files
  2. Add at least one test file

Commands:

# Create tests directory
mkdir -p tests
touch tests/__init__.py
touch tests/test_example.py

Examples:

# src layout (recommended for distributable packages)
project/
├── src/
│   └── mypackage/
│       ├── __init__.py
│       └── module.py
├── tests/
│   └── test_module.py
└── pyproject.toml

# flat layout (common in major projects like pandas, numpy)
project/
├── mypackage/
│   ├── __init__.py
│   └── module.py
├── tests/
│   └── test_module.py
└── pyproject.toml

T1 CI Quality Gates ❌ 65/100

📝 Remediation Steps

Measured: missing quality gates (Threshold: CI with lint + test + type-check gates on PRs)

Evidence:

  • CI config found: .github/workflows/release.yml, .github/workflows/run-ui-tests.yml, .github/workflows/agentready-assessment.yml, .github/workflows/build.yml
  • No lint gate found in CI
  • No test gate found in CI
  • No type-check gate found in CI
  • Descriptive job/step names found
  • Parallel job execution detected
  • Config includes comments
  • Artifacts uploaded

Add or improve CI/CD pipeline configuration

  1. Create CI config for your platform (GitHub Actions, GitLab CI, etc.)
  2. Define jobs: lint, test, build
  3. Use descriptive job and step names
  4. Configure dependency caching
  5. Enable parallel job execution
  6. Upload artifacts: test results, coverage reports
  7. Add status badge to README

Commands:

# Create GitHub Actions workflow
mkdir -p .github/workflows
touch .github/workflows/ci.yml

# Validate workflow
gh workflow view ci.yml

Examples:

# .github/workflows/ci.yml - Good example

name: CI Pipeline

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  lint:
    name: Lint Code
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: '3.11'
          cache: 'pip'  # Caching

      - name: Install dependencies
        run: pip install -r requirements.txt

      - name: Run linters
        run: |
          black --check .
          isort --check .
          ruff check .

  test:
    name: Run Tests
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: '3.11'
          cache: 'pip'

      - name: Install dependencies
        run: pip install -r requirements.txt

      - name: Run tests with coverage
        run: pytest --cov --cov-report=xml

      - name: Upload coverage reports
        uses: codecov/codecov-action@v3
        with:
          files: ./coverage.xml

  build:
    name: Build Package
    runs-on: ubuntu-latest
    needs: [lint, test]  # Runs after lint/test pass
    steps:
      - uses: actions/checkout@v4

      - name: Build package
        run: python -m build

      - name: Upload build artifacts
        uses: actions/upload-artifact@v3
        with:
          name: dist
          path: dist/

T1 Dependency Security & Vulnerability Scanning ✅ 55/100

T1 Agent Instruction Files ✅ 85/100

T1 README Structure ✅ 100/100

T1 Test Execution & Coverage ⊘

T1 Type Annotations ⊘

T1 dbt Project Configuration ⊘

T1 dbt Model Documentation ⊘

T2 Conventional Commit Messages ❌ 0/100

📝 Remediation Steps

Measured: not configured (Threshold: configured)

Evidence:

  • No commitlint configuration found (.commitlintrc.json, package.json, husky, or pre-commit)

Configure conventional commits with commitlint

  1. Option A (Python/pre-commit): Add conventional-pre-commit to .pre-commit-config.yaml
  2. Option B (JS/commitlint): Install commitlint and configure husky for commit-msg hook

Commands:

# Python (pre-commit):
pip install pre-commit && pre-commit install --hook-type commit-msg
# JS (commitlint + husky):
npm install --save-dev @commitlint/cli @commitlint/config-conventional husky

T2 Pattern References for Common Changes ❌ 0/100

📝 Remediation Steps

Measured: none found (Threshold: pattern references or skills documented)

Evidence:

  • AGENTS.md is 165 lines with no skills; consider extracting patterns into .claude/skills/

Add pattern references for 3-5 common change types

  1. Identify your 3-5 most common change types (new endpoint, new component, etc.)
  2. For each, point to one real example in the codebase
  3. Create .claude/skills/ directory with SKILL.md files for detailed patterns
  4. Or add a 'Pattern References' section to CLAUDE.md/AGENTS.md

Commands:

mkdir -p .claude/skills

Examples:

# In CLAUDE.md:
## Pattern References
- New API endpoint: follow the pattern in `src/api/handlers/users.ts`
- New adapter: see `src/adapters/postgres.py` as reference

T2 One-Command Build/Setup ❌ 30/100

📝 Remediation Steps

Measured: multi-step setup (Threshold: single command)

Evidence:

  • No clear setup command found in README
  • No Makefile or setup script found
  • Setup instructions in prominent location

Create single-command setup for development environment

  1. Choose setup automation tool (Makefile, setup script, or package manager)
  2. Create setup command that handles all dependencies
  3. Document setup command prominently in README (Quick Start section)
  4. Ensure setup is idempotent (safe to run multiple times)
  5. Test setup on fresh clone to verify it works

Commands:

# Example Makefile
cat > Makefile << 'EOF'
.PHONY: setup
setup:
	python -m venv venv
	. venv/bin/activate && pip install -r requirements.txt
	pre-commit install
	cp .env.example .env
	@echo 'Setup complete! Run make test to verify.'
EOF

Examples:

# Quick Start section in README

## Quick Start

```bash
make setup  # One command to set up development environment
make test   # Run tests to verify setup

</details>

![T2](https://img.shields.io/badge/T2-Design_Intent_Documentation_30--100-red) **Design Intent Documentation** ❌ 30/100
<details>
<summary>📝 Remediation Steps</summary>

**Measured**: minimal (Threshold: design docs with preconditions/invariants)

**Evidence**:
- Design intent language found in AGENTS.md

Document design intent: preconditions, invariants, and rationale

1. Create docs/design/ directory
2. For each critical module, document preconditions, invariants, and rationale
3. Use an AI agent to reverse-engineer initial design docs from code, then enrich with intent
4. Reference design docs from CLAUDE.md/AGENTS.md
5. Add a rule to AGENTS.md requiring design doc updates with architectural changes
6. For stronger enforcement, add a hook or skill that checks for design doc updates

**Commands**:
```bash
mkdir -p docs/design

Examples:

# docs/design/event-system.md
## Invariants
- Event log is append-only; never mutate or delete entries
- Events are processed exactly-once via idempotency keys

## Preconditions
- Auth middleware must validate token before event handlers run

## Rationale
- Polling instead of webhooks: upstream API has 5s delivery SLA, too slow for our use case
# AGENTS.md - Advisory enforcement
## Design Documentation
When modifying component boundaries, data flows, or API contracts,
review and update the corresponding design doc in docs/design/.

T2 Deterministic Enforcement (Hooks & Lint Rules) ✅ 40/100

T2 .gitignore Completeness ✅ 100/100

T2 Separation of Concerns ✅ 100/100

T2 File Size Limits ⊘

T2 Inline Documentation ⊘

T2 Lint Config Coverage ⊘

T2 dbt Data Tests ⊘

T2 dbt Project Structure ⊘

T3 Architecture Decision Records (ADRs) ❌ 0/100

📝 Remediation Steps

Measured: no ADR directory (Threshold: ADR directory with decisions)

Evidence:

  • No ADR directory found (checked docs/adr/, docs/architecture/, docs/design/, docs/specs/, specs/, and variants — all case-insensitive)

Create Architecture Decision Records (ADRs) directory and document key decisions

  1. Create docs/adr/ directory in repository root
  2. Use Michael Nygard ADR template or MADR format
  3. Document each significant architectural decision
  4. Number ADRs sequentially (0001-.md, 0002-.md)
  5. Include Status, Context, Decision, and Consequences sections
  6. Update ADR status when decisions are revised (Superseded, Deprecated)

Commands:

# Create ADR directory
mkdir -p docs/adr

# Create first ADR using template
cat > docs/adr/0001-use-architecture-decision-records.md << 'EOF'
# 1. Use Architecture Decision Records

Date: 2025-11-22

## Status
Accepted

## Context
We need to record architectural decisions made in this project.

## Decision
We will use Architecture Decision Records (ADRs) as described by Michael Nygard.

## Consequences
- Decisions are documented with context
- Future contributors understand rationale
- ADRs are lightweight and version-controlled
EOF

Examples:

# Example ADR Structure

```markdown
# 2. Use PostgreSQL for Database

Date: 2025-11-22

## Status
Accepted

## Context
We need a relational database for complex queries and ACID transactions.
Team has PostgreSQL experience. Need full-text search capabilities.

## Decision
Use PostgreSQL 15+ as primary database.

## Consequences
- Positive: Robust ACID, full-text search, team familiarity
- Negative: Higher resource usage than SQLite
- Neutral: Need to manage migrations, backups

</details>

![T3](https://img.shields.io/badge/T3-Threat_Model_Documentation_0--100-red) **Threat Model Documentation** ❌ 0/100
<details>
<summary>📝 Remediation Steps</summary>

**Measured**: no threat model found (Threshold: THREAT_MODEL.md with structured sections)

**Evidence**:
- No THREAT_MODEL.md or equivalent found

Create a THREAT_MODEL.md with structured security analysis

1. Create THREAT_MODEL.md in the repository root
2. Add the 8-section structure: System context, Assets, Entry points, Threats, Deprioritized, Open questions, Provenance, Recommended mitigations
3. Start with system context describing what the project does and its security assumptions
4. List assets (what is worth protecting) with sensitivity levels
5. Document entry points where untrusted input enters the system
6. Add a threat table with actor, impact, likelihood, and status columns
7. Explicitly list deprioritized threats with rationale
8. Point SECURITY.md at the threat model for scope guidance

**Examples**:

Threat Model: MyProject

1. System context

A REST API that processes user uploads...

2. Assets

asset description sensitivity
user_data PII in database high

3. Entry points & trust boundaries

entry_point description trust_boundary reachable_assets
/api/upload File upload endpoint remote unauth user_data

4. Threats

id threat actor impact status
T1 RCE via file upload remote_unauth critical partially_mitigated

5. Deprioritized

threat reason
Local file injection Requires local admin access

6. Open questions

  • Is the upload size limit enforced at the proxy level?

7. Provenance

  • mode: bootstrap
  • date: 2026-01-15

8. Recommended mitigations

mitigation threat_ids effort
Sandbox file processing T1 M

</details>

![T3](https://img.shields.io/badge/T3-ADR_Frontmatter_Completeness_N--A-lightgray) **ADR Frontmatter Completeness** ⊘ 

![T3](https://img.shields.io/badge/T3-OpenAPI%2FSwagger_Specifications_N--A-lightgray) **OpenAPI/Swagger Specifications** ⊘ 

![T3](https://img.shields.io/badge/T3-Cyclomatic_Complexity_Thresholds_N--A-lightgray) **Cyclomatic Complexity Thresholds** ⊘ 

![T3](https://img.shields.io/badge/T3-Structured_Logging_N--A-lightgray) **Structured Logging** ⊘ 

![T3](https://img.shields.io/badge/T3-Progressive_Disclosure_N--A-lightgray) **Progressive Disclosure** ⊘ 

![T3](https://img.shields.io/badge/T3-Architectural_Boundary_Lint_Rules_N--A-lightgray) **Architectural Boundary Lint Rules** ⊘ 

![T3](https://img.shields.io/badge/T3-Lint_Suppression_Density_N--A-lightgray) **Lint Suppression Density** ⊘ 

![T4](https://img.shields.io/badge/T4-Issue_%26_Pull_Request_Templates_50--100-red) **Issue & Pull Request Templates** ❌ 50/100
<details>
<summary>📝 Remediation Steps</summary>

**Measured**: PR:True, Issues:0 (Threshold: PR template + ≥2 issue templates)

**Evidence**:
- PR template found
- No issue template directory found

Create GitHub issue and PR templates in .github/ directory

1. Create .github/ directory if it doesn't exist
2. Add PULL_REQUEST_TEMPLATE.md for PRs
3. Create .github/ISSUE_TEMPLATE/ directory
4. Add bug_report.md for bug reports
5. Add feature_request.md for feature requests
6. Optionally add config.yml to configure template chooser
7. Note: org-level templates in <org>/.github are also recognized

**Commands**:
```bash
# Create directories
mkdir -p .github/ISSUE_TEMPLATE

# Create PR template
cat > .github/PULL_REQUEST_TEMPLATE.md << 'EOF'
## Summary
<!-- Describe the changes in this PR -->

## Related Issues
Fixes #

## Testing
- [ ] Tests added/updated
- [ ] All tests pass

## Checklist
- [ ] Documentation updated
- [ ] CHANGELOG.md updated
EOF

Examples:

# Bug Report Template (.github/ISSUE_TEMPLATE/bug_report.md)

```markdown
---
name: Bug Report
about: Create a report to help us improve
title: '[BUG] '
labels: bug
assignees: ''
---

**Describe the bug**
A clear description of what the bug is.

**To Reproduce**
Steps to reproduce:
1. Go to '...'
2. Click on '....'
3. See error

**Expected behavior**
What you expected to happen.

**Environment**
- OS: [e.g. macOS 13.0]
- Version: [e.g. 1.0.0]

</details>

![T4](https://img.shields.io/badge/T4-Container%2FVirtualization_Setup_N--A-lightgray) **Container/Virtualization Setup** ⊘ 


---

## 📝 Assessment Metadata

- **AgentReady Version**: v2.52.3
- **Research Version**: v2.0.1
- **Repository Snapshot**: 8d3500086c37499973210667598af6a9128ef2be
- **Assessment Duration**: 0.6s
- **Assessed By**: runner@runnervmccnms
- **Assessment Date**: November 19, 2026 at 8:31 PM

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---

# 🤖 AgentReady Assessment Report

**Repository**: devspaces-gateway-plugin
**Path**: `/home/runner/work/devspaces-gateway-plugin/devspaces-gateway-plugin`
**Branch**: `HEAD` | **Commit**: `8d350008`
**Assessed**: November 19, 2026 at 8:31 PM
**AgentReady Version**: 2.52.3
**Run by**: runner@runnervmccnms

---

## 📊 Summary

| Metric | Value |
|--------|-------|
| **Overall Score** | **46.6/100** 🥉 **Bronze** ([Tier Definitions](https://ambient-code.github.io/agentready/attributes.html#tier-system)) |
| **Attributes Assessed** | 17/34 |
| **Attributes Not Assessed** | 17 |
| **Assessment Duration** | 0.6s |

### Languages Detected

- **Kotlin**: 222 files
- **Markdown**: 10 files
- **YAML**: 9 files
- **XML**: 7 files

### Repository Stats

- **Total Files**: 297
- **Total Lines**: 40,001

## 🎯 Priority Improvements

Focus on these high-impact fixes first:

1. **Single-File Verification** (Tier 1) - +5.0 points potential
   - Document single-file lint and type-check commands in CLAUDE.md/AGENTS.md
2. **Dependency Pinning for Reproducibility** (Tier 1) - +5.0 points potential
   - Add lock file for dependency reproducibility
3. **Standard Project Layouts** (Tier 1) - +5.0 points potential
   - Organize code into standard directories
4. **CI Quality Gates** (Tier 1) - +5.0 points potential
   - Add or improve CI/CD pipeline configuration
5. **Conventional Commit Messages** (Tier 2) - +3.0 points potential
   - Configure conventional commits with commitlint

## 📋 Detailed Findings

Findings sorted by priority (Tier 1 failures first, then Tier 2, etc.)

![T1](https://img.shields.io/badge/T1-Single-File_Verification_0--100-red) **Single-File Verification** ❌ 0/100
<details>
<summary>📝 Remediation Steps</summary>

**Measured**: not documented (Threshold: single-file lint + type-check commands documented)

**Evidence**:
- No single-file verification commands found in context files

Document single-file lint and type-check commands in CLAUDE.md/AGENTS.md

1. Add single-file lint command to context file (e.g., 'ruff check path/to/file.py')
2. Add single-file type-check command (e.g., 'mypy path/to/file.py')
3. Ensure these commands work without a full build step
4. Target <5 seconds execution per file

**Commands**:
```bash
# Python
ruff check path/to/file.py
mypy path/to/file.py

# JavaScript/TypeScript
npx eslint path/to/file.ts
npx tsc --noEmit path/to/file.ts

# Go
golangci-lint run path/to/file.go
go vet path/to/file.go

# YAML / Shell
yamllint path/to/file.yaml
shellcheck path/to/script.sh
bash -n path/to/script.sh

T1 Dependency Pinning for Reproducibility ❌ 0/100

📝 Remediation Steps

Measured: none (Threshold: lock file with pinned versions)

Evidence:

  • No dependency lock files found

Add lock file for dependency reproducibility

  1. For Go: run 'go mod tidy' (generates go.sum)
  2. For npm: run 'npm install' (generates package-lock.json)
  3. For Python: use 'pip freeze > requirements.txt' or poetry
  4. For Ruby: run 'bundle install' (generates Gemfile.lock)
  5. For Terraform: run 'terraform providers lock' (generates .terraform.lock.hcl)

Commands:

go mod tidy  # Go
npm install  # npm
pip freeze > requirements.txt  # Python
poetry lock  # Python with Poetry
terraform providers lock  # Terraform

T1 Standard Project Layouts ❌ 50/100

📝 Remediation Steps

Measured: 1/2 directories (Threshold: 2/2 directories)

Evidence:

  • Found 1/2 standard directories
  • src/: ✓
  • tests/: ✗
  • Naming consistency: ✓ (consistent conventions)

Organize code into standard directories

  1. Create tests/ directory for test files
  2. Add at least one test file

Commands:

# Create tests directory
mkdir -p tests
touch tests/__init__.py
touch tests/test_example.py

Examples:

# src layout (recommended for distributable packages)
project/
├── src/
│   └── mypackage/
│       ├── __init__.py
│       └── module.py
├── tests/
│   └── test_module.py
└── pyproject.toml

# flat layout (common in major projects like pandas, numpy)
project/
├── mypackage/
│   ├── __init__.py
│   └── module.py
├── tests/
│   └── test_module.py
└── pyproject.toml

T1 CI Quality Gates ❌ 65/100

📝 Remediation Steps

Measured: missing quality gates (Threshold: CI with lint + test + type-check gates on PRs)

Evidence:

  • CI config found: .github/workflows/release.yml, .github/workflows/run-ui-tests.yml, .github/workflows/agentready-assessment.yml, .github/workflows/build.yml
  • No lint gate found in CI
  • No test gate found in CI
  • No type-check gate found in CI
  • Descriptive job/step names found
  • Parallel job execution detected
  • Config includes comments
  • Artifacts uploaded

Add or improve CI/CD pipeline configuration

  1. Create CI config for your platform (GitHub Actions, GitLab CI, etc.)
  2. Define jobs: lint, test, build
  3. Use descriptive job and step names
  4. Configure dependency caching
  5. Enable parallel job execution
  6. Upload artifacts: test results, coverage reports
  7. Add status badge to README

Commands:

# Create GitHub Actions workflow
mkdir -p .github/workflows
touch .github/workflows/ci.yml

# Validate workflow
gh workflow view ci.yml

Examples:

# .github/workflows/ci.yml - Good example

name: CI Pipeline

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  lint:
    name: Lint Code
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: '3.11'
          cache: 'pip'  # Caching

      - name: Install dependencies
        run: pip install -r requirements.txt

      - name: Run linters
        run: |
          black --check .
          isort --check .
          ruff check .

  test:
    name: Run Tests
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: '3.11'
          cache: 'pip'

      - name: Install dependencies
        run: pip install -r requirements.txt

      - name: Run tests with coverage
        run: pytest --cov --cov-report=xml

      - name: Upload coverage reports
        uses: codecov/codecov-action@v3
        with:
          files: ./coverage.xml

  build:
    name: Build Package
    runs-on: ubuntu-latest
    needs: [lint, test]  # Runs after lint/test pass
    steps:
      - uses: actions/checkout@v4

      - name: Build package
        run: python -m build

      - name: Upload build artifacts
        uses: actions/upload-artifact@v3
        with:
          name: dist
          path: dist/

T1 Dependency Security & Vulnerability Scanning ✅ 55/100

T1 Agent Instruction Files ✅ 85/100

T1 README Structure ✅ 100/100

T1 Test Execution & Coverage ⊘

T1 Type Annotations ⊘

T1 dbt Project Configuration ⊘

T1 dbt Model Documentation ⊘

T2 Conventional Commit Messages ❌ 0/100

📝 Remediation Steps

Measured: not configured (Threshold: configured)

Evidence:

  • No commitlint configuration found (.commitlintrc.json, package.json, husky, or pre-commit)

Configure conventional commits with commitlint

  1. Option A (Python/pre-commit): Add conventional-pre-commit to .pre-commit-config.yaml
  2. Option B (JS/commitlint): Install commitlint and configure husky for commit-msg hook

Commands:

# Python (pre-commit):
pip install pre-commit && pre-commit install --hook-type commit-msg
# JS (commitlint + husky):
npm install --save-dev @commitlint/cli @commitlint/config-conventional husky

T2 Pattern References for Common Changes ❌ 0/100

📝 Remediation Steps

Measured: none found (Threshold: pattern references or skills documented)

Evidence:

  • AGENTS.md is 165 lines with no skills; consider extracting patterns into .claude/skills/

Add pattern references for 3-5 common change types

  1. Identify your 3-5 most common change types (new endpoint, new component, etc.)
  2. For each, point to one real example in the codebase
  3. Create .claude/skills/ directory with SKILL.md files for detailed patterns
  4. Or add a 'Pattern References' section to CLAUDE.md/AGENTS.md

Commands:

mkdir -p .claude/skills

Examples:

# In CLAUDE.md:
## Pattern References
- New API endpoint: follow the pattern in `src/api/handlers/users.ts`
- New adapter: see `src/adapters/postgres.py` as reference

T2 One-Command Build/Setup ❌ 30/100

📝 Remediation Steps

Measured: multi-step setup (Threshold: single command)

Evidence:

  • No clear setup command found in README
  • No Makefile or setup script found
  • Setup instructions in prominent location

Create single-command setup for development environment

  1. Choose setup automation tool (Makefile, setup script, or package manager)
  2. Create setup command that handles all dependencies
  3. Document setup command prominently in README (Quick Start section)
  4. Ensure setup is idempotent (safe to run multiple times)
  5. Test setup on fresh clone to verify it works

Commands:

# Example Makefile
cat > Makefile << 'EOF'
.PHONY: setup
setup:
	python -m venv venv
	. venv/bin/activate && pip install -r requirements.txt
	pre-commit install
	cp .env.example .env
	@echo 'Setup complete! Run make test to verify.'
EOF

Examples:

# Quick Start section in README

## Quick Start

```bash
make setup  # One command to set up development environment
make test   # Run tests to verify setup

</details>

![T2](https://img.shields.io/badge/T2-Design_Intent_Documentation_30--100-red) **Design Intent Documentation** ❌ 30/100
<details>
<summary>📝 Remediation Steps</summary>

**Measured**: minimal (Threshold: design docs with preconditions/invariants)

**Evidence**:
- Design intent language found in AGENTS.md

Document design intent: preconditions, invariants, and rationale

1. Create docs/design/ directory
2. For each critical module, document preconditions, invariants, and rationale
3. Use an AI agent to reverse-engineer initial design docs from code, then enrich with intent
4. Reference design docs from CLAUDE.md/AGENTS.md
5. Add a rule to AGENTS.md requiring design doc updates with architectural changes
6. For stronger enforcement, add a hook or skill that checks for design doc updates

**Commands**:
```bash
mkdir -p docs/design

Examples:

# docs/design/event-system.md
## Invariants
- Event log is append-only; never mutate or delete entries
- Events are processed exactly-once via idempotency keys

## Preconditions
- Auth middleware must validate token before event handlers run

## Rationale
- Polling instead of webhooks: upstream API has 5s delivery SLA, too slow for our use case
# AGENTS.md - Advisory enforcement
## Design Documentation
When modifying component boundaries, data flows, or API contracts,
review and update the corresponding design doc in docs/design/.

T2 Deterministic Enforcement (Hooks & Lint Rules) ✅ 40/100

T2 .gitignore Completeness ✅ 100/100

T2 Separation of Concerns ✅ 100/100

T2 File Size Limits ⊘

T2 Inline Documentation ⊘

T2 Lint Config Coverage ⊘

T2 dbt Data Tests ⊘

T2 dbt Project Structure ⊘

T3 Architecture Decision Records (ADRs) ❌ 0/100

📝 Remediation Steps

Measured: no ADR directory (Threshold: ADR directory with decisions)

Evidence:

  • No ADR directory found (checked docs/adr/, docs/architecture/, docs/design/, docs/specs/, specs/, and variants — all case-insensitive)

Create Architecture Decision Records (ADRs) directory and document key decisions

  1. Create docs/adr/ directory in repository root
  2. Use Michael Nygard ADR template or MADR format
  3. Document each significant architectural decision
  4. Number ADRs sequentially (0001-.md, 0002-.md)
  5. Include Status, Context, Decision, and Consequences sections
  6. Update ADR status when decisions are revised (Superseded, Deprecated)

Commands:

# Create ADR directory
mkdir -p docs/adr

# Create first ADR using template
cat > docs/adr/0001-use-architecture-decision-records.md << 'EOF'
# 1. Use Architecture Decision Records

Date: 2025-11-22

## Status
Accepted

## Context
We need to record architectural decisions made in this project.

## Decision
We will use Architecture Decision Records (ADRs) as described by Michael Nygard.

## Consequences
- Decisions are documented with context
- Future contributors understand rationale
- ADRs are lightweight and version-controlled
EOF

Examples:

# Example ADR Structure

```markdown
# 2. Use PostgreSQL for Database

Date: 2025-11-22

## Status
Accepted

## Context
We need a relational database for complex queries and ACID transactions.
Team has PostgreSQL experience. Need full-text search capabilities.

## Decision
Use PostgreSQL 15+ as primary database.

## Consequences
- Positive: Robust ACID, full-text search, team familiarity
- Negative: Higher resource usage than SQLite
- Neutral: Need to manage migrations, backups

</details>

![T3](https://img.shields.io/badge/T3-Threat_Model_Documentation_0--100-red) **Threat Model Documentation** ❌ 0/100
<details>
<summary>📝 Remediation Steps</summary>

**Measured**: no threat model found (Threshold: THREAT_MODEL.md with structured sections)

**Evidence**:
- No THREAT_MODEL.md or equivalent found

Create a THREAT_MODEL.md with structured security analysis

1. Create THREAT_MODEL.md in the repository root
2. Add the 8-section structure: System context, Assets, Entry points, Threats, Deprioritized, Open questions, Provenance, Recommended mitigations
3. Start with system context describing what the project does and its security assumptions
4. List assets (what is worth protecting) with sensitivity levels
5. Document entry points where untrusted input enters the system
6. Add a threat table with actor, impact, likelihood, and status columns
7. Explicitly list deprioritized threats with rationale
8. Point SECURITY.md at the threat model for scope guidance

**Examples**:

Threat Model: MyProject

1. System context

A REST API that processes user uploads...

2. Assets

asset description sensitivity
user_data PII in database high

3. Entry points & trust boundaries

entry_point description trust_boundary reachable_assets
/api/upload File upload endpoint remote unauth user_data

4. Threats

id threat actor impact status
T1 RCE via file upload remote_unauth critical partially_mitigated

5. Deprioritized

threat reason
Local file injection Requires local admin access

6. Open questions

  • Is the upload size limit enforced at the proxy level?

7. Provenance

  • mode: bootstrap
  • date: 2026-01-15

8. Recommended mitigations

mitigation threat_ids effort
Sandbox file processing T1 M

</details>

![T3](https://img.shields.io/badge/T3-ADR_Frontmatter_Completeness_N--A-lightgray) **ADR Frontmatter Completeness** ⊘ 

![T3](https://img.shields.io/badge/T3-OpenAPI%2FSwagger_Specifications_N--A-lightgray) **OpenAPI/Swagger Specifications** ⊘ 

![T3](https://img.shields.io/badge/T3-Cyclomatic_Complexity_Thresholds_N--A-lightgray) **Cyclomatic Complexity Thresholds** ⊘ 

![T3](https://img.shields.io/badge/T3-Structured_Logging_N--A-lightgray) **Structured Logging** ⊘ 

![T3](https://img.shields.io/badge/T3-Progressive_Disclosure_N--A-lightgray) **Progressive Disclosure** ⊘ 

![T3](https://img.shields.io/badge/T3-Architectural_Boundary_Lint_Rules_N--A-lightgray) **Architectural Boundary Lint Rules** ⊘ 

![T3](https://img.shields.io/badge/T3-Lint_Suppression_Density_N--A-lightgray) **Lint Suppression Density** ⊘ 

![T4](https://img.shields.io/badge/T4-Issue_%26_Pull_Request_Templates_50--100-red) **Issue & Pull Request Templates** ❌ 50/100
<details>
<summary>📝 Remediation Steps</summary>

**Measured**: PR:True, Issues:0 (Threshold: PR template + ≥2 issue templates)

**Evidence**:
- PR template found
- No issue template directory found

Create GitHub issue and PR templates in .github/ directory

1. Create .github/ directory if it doesn't exist
2. Add PULL_REQUEST_TEMPLATE.md for PRs
3. Create .github/ISSUE_TEMPLATE/ directory
4. Add bug_report.md for bug reports
5. Add feature_request.md for feature requests
6. Optionally add config.yml to configure template chooser
7. Note: org-level templates in <org>/.github are also recognized

**Commands**:
```bash
# Create directories
mkdir -p .github/ISSUE_TEMPLATE

# Create PR template
cat > .github/PULL_REQUEST_TEMPLATE.md << 'EOF'
## Summary
<!-- Describe the changes in this PR -->

## Related Issues
Fixes #

## Testing
- [ ] Tests added/updated
- [ ] All tests pass

## Checklist
- [ ] Documentation updated
- [ ] CHANGELOG.md updated
EOF

Examples:

# Bug Report Template (.github/ISSUE_TEMPLATE/bug_report.md)

```markdown
---
name: Bug Report
about: Create a report to help us improve
title: '[BUG] '
labels: bug
assignees: ''
---

**Describe the bug**
A clear description of what the bug is.

**To Reproduce**
Steps to reproduce:
1. Go to '...'
2. Click on '....'
3. See error

**Expected behavior**
What you expected to happen.

**Environment**
- OS: [e.g. macOS 13.0]
- Version: [e.g. 1.0.0]

</details>

![T4](https://img.shields.io/badge/T4-Container%2FVirtualization_Setup_N--A-lightgray) **Container/Virtualization Setup** ⊘ 


---

## 📝 Assessment Metadata

- **AgentReady Version**: v2.52.3
- **Research Version**: v2.0.1
- **Repository Snapshot**: 8d3500086c37499973210667598af6a9128ef2be
- **Assessment Duration**: 0.6s
- **Assessed By**: runner@runnervmccnms
- **Assessment Date**: November 19, 2026 at 8:31 PM

🤖 Generated with [Claude Code](https://claude.com/claude-code)

@codecov-commenter

codecov-commenter commented Nov 18, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 78.81944% with 122 lines in your changes missing coverage. Please review.
✅ Project coverage is 50.97%. Comparing base (aca165a) to head (d924d16).

Files with missing lines Patch % Lines
...com/redhat/devtools/gateway/DevSpacesConnection.kt 17.72% 64 Missing and 1 partial ⚠️
...hat/devtools/gateway/openshift/PodPortForwarder.kt 89.79% 7 Missing and 8 partials ⚠️
...dhat/devtools/gateway/ThinClientRecoveryWatcher.kt 94.17% 2 Missing and 10 partials ⚠️
...edhat/devtools/gateway/openshift/ForwardAttempt.kt 54.16% 9 Missing and 2 partials ⚠️
.../redhat/devtools/gateway/server/RemoteIDEServer.kt 78.12% 2 Missing and 5 partials ⚠️
.../com/redhat/devtools/gateway/ThinClientJoinLink.kt 80.00% 2 Missing and 4 partials ⚠️
...hat/devtools/gateway/openshift/DevWorkspacePods.kt 25.00% 0 Missing and 6 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #412      +/-   ##
==========================================
+ Coverage   48.59%   50.97%   +2.38%     
==========================================
  Files         143      145       +2     
  Lines        6297     6801     +504     
  Branches     1226     1321      +95     
==========================================
+ Hits         3060     3467     +407     
- Misses       2884     2955      +71     
- Partials      353      379      +26     
Flag Coverage Δ
unit-tests 50.97% <78.81%> (+2.38%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Qodana for JVM

13 new problems were found

Inspection name Severity Problems
Unstable API Usage 🔶 Warning 7
Long overload to Duration conversion 🔶 Warning 3
Constructor parameter is never used as a property 🔶 Warning 2
Unresolved link in KDoc 🔶 Warning 1

💡 Qodana analysis was run in the pull request mode: only the changed files were checked

View the detailed Qodana report

To be able to view the detailed Qodana report, you can either:

To get *.log files or any other Qodana artifacts, run the action with upload-result option set to true,
so that the action will upload the files as the job artifacts:

      - name: 'Qodana Scan'
        uses: JetBrains/qodana-action@v2026.2.2
        with:
          upload-result: true
Contact Qodana team

Contact us at qodana-support@jetbrains.com

@github-actions

Copy link
Copy Markdown
Contributor

✅ Build successful! For testing, download plugin zip from the Artifacts section.

…3910)

Live testing showed the watcher never prodded on a pod roll: it
reported recovery on a mere active TCP copy, and the Guest's
doomed dials (~6.5s, its own transport timeout) classified as
long-lived, so the stale link was never refreshed. A replaced
pod now marks the cached link stale by identity (new pod = new
server session) and the first prod carries a refreshed link.
Recovery evidence is a dial that survived 15s, never an open
copy; client-closed doomed dials no longer end the episode.

Signed-off-by: Andre Dietisheim <adietish@redhat.com>
@github-actions

Copy link
Copy Markdown
Contributor

✅ Build successful! For testing, download plugin zip from the Artifacts section.

Live testing showed the prod cancels the Guest's own seamless
reconnection mid-handshake: forceReconnect restarts the project
(disposing the frame), so a needless prod swaps the window. The
watcher now observes the Guest's dial cycle first — a dial in
flight is never interrupted; recovery reports on a surviving
dial with zero prods. A prod is reserved for a rolled pod, a
proven-failing seamless loop, or a Guest that stopped dialing.

Signed-off-by: Andre Dietisheim <adietish@redhat.com>
@github-actions

Copy link
Copy Markdown
Contributor

✅ Build successful! For testing, download plugin zip from the Artifacts section.

Live testing showed the watcher prodded the cached link when a
stale link could not be refreshed yet (restarted idea-server not
reporting a status). Each such prod disposes the Guest's project
against a dead session and burns one of its project-open retries
- the Guest closed itself after two (exitCode 178). A stale link
with no replacement now waits: zero prods until the IDE server
reports a fresh link, budget ends in the failure report.

Signed-off-by: Andre Dietisheim <adietish@redhat.com>
@github-actions

Copy link
Copy Markdown
Contributor

✅ Build successful! For testing, download plugin zip from the Artifacts section.

client-java's PortForward.forward ends in an unbounded
Object.wait (WebSocketStreamHandler.waitForInitialized). A
stalled websocket - observed right after killing the idea-server -
hangs the dial's first attempt forever: the retry policy and the
client-gone probe are behind the blocked call, and the recovery
watcher's observation freezes on a permanently in-flight dial
(live thread dump attached to the commit context). The open is
now interruptible and bounded (10s): a stalled open surfaces as
a retryable handshake failure, and the blocked thread is freed.

Signed-off-by: Andre Dietisheim <adietish@redhat.com>
@github-actions

Copy link
Copy Markdown
Contributor

✅ Build successful! For testing, download plugin zip from the Artifacts section.

The watcher can end without any log output when its coroutine is
cancelled from outside; a live session showed exactly that with
no way to attribute it. The loop's finally now always logs its
end state, stop() and stopRecovery() log the caller stack, and
the observation phase samples its dial view every ~5s at debug.

Signed-off-by: Andre Dietisheim <adietish@redhat.com>
@github-actions

Copy link
Copy Markdown
Contributor

✅ Build successful! For testing, download plugin zip from the Artifacts section.

In-place idea-server restart: the Guest's seamless loop re-dials
every ~5 s while each doomed dial lives ~6.5 s (its 6 s transport
timeout), so dials overlap permanently and the observation's
in-flight guard never released - zero prods, no recovery until the
budget.

A failed dial only counts when its forward handshake was delivered
and the Guest still dropped it within the confirmation window -
the stale-link signature. Two of them prove every dial carrying
the cached link is doomed, including the one in flight; prodding
it costs nothing, waiting for its end changes nothing.

A network cut keeps its protection: its dials never handshake, so
failedDials stays flat and the in-flight dial is still awaited.

Signed-off-by: Andre Dietisheim <adietish@redhat.com>
@github-actions

Copy link
Copy Markdown
Contributor

✅ Build successful! For testing, download plugin zip from the Artifacts section.

@adietish adietish closed this Nov 19, 2026
@adietish
adietish deleted the CRW-13910 branch November 19, 2026 22:30
@adietish

adietish commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator Author

Closed because it's using the wrong source repo: PR should be filed from my fork to main. Replaced by #397

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants