code-certification

module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2026 License: MIT

README ΒΆ

Certify

Certify

CI Certification VS Marketplace

Code trust, with an expiration date.

Certify continuously evaluates every code unit in your repository, scores it against versioned policies, and assigns time-bound certification you can actually trust.

CI tells you whether code passes right now. Certify tells you whether code should still be trusted.

πŸ“‹ View our report card β†’ Β· πŸ“– Documentation β†’ Β· 🧩 VSCode Extension β†’


Why Certify

Code that once passed review doesn't stay trustworthy forever. Standards evolve, dependencies change, systems grow more complex.

Certify introduces continuous code certification β€” measurable quality scores with certification that expires intentionally. When certification lapses, code must be re-evaluated against current standards.

Instead of treating quality as a one-time event, Certify makes it a continuous process of trust, verification, and renewal.


Install

go install github.com/iksnae/code-certification/cmd/certify@latest

Or build from source:

git clone https://github.com/iksnae/code-certification.git
cd code-certification
go build -o certify ./cmd/certify/

Requires: Go 1.22+, Git

VSCode Extension

See certification grades inline on every function, open an interactive dashboard, and configure AI providers visually.

code --install-extension iksnae.certify-vscode

Features: CodeLens grade annotations Β· Dashboard WebView Β· Tree View sidebar Β· Status Bar badge Β· Diagnostics for failing units Β· Provider configurator with 11 presets + any custom endpoint Β· Model browser with live discovery

Extension guide β†’


Quick Start

cd your-repo

# 1. Bootstrap β€” creates config, policies, and CI workflows
certify init

# 2. Discover β€” finds every function, method, type, and file
certify scan

# 3. Certify β€” collects evidence, evaluates, scores
certify certify

# 4. Report β€” generates your report card
certify report --format full

Your report card is at .certification/REPORT_CARD.md.


What You Get

Report Card

A complete per-unit certification of your entire codebase:

# 🟒 Certify β€” Full Report

## Summary
| Overall Grade | 🟒 B |
| Total Units   | 474  |
| Pass Rate     | 100% |

## Dimension Averages
| correctness              | 95.0% | β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘ |
| maintainability          | 93.3% | β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘ |
| readability              | 92.4% | β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘ |
| testability              | 90.0% | β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘ |
| security                 | 80.0% | β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘ |

## All Units (organized by directory)
| Score         | function | B | 86.7% | certified | 2026-06-07 |
| CertifyUnit   | function | B | 85.6% | certified | 2026-06-07 |
... every unit in your repo

Certification Badge

Add a live badge to your README β€” it updates automatically:

certify report --badge

Outputs:

[![Certification](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/OWNER/REPO/main/.certification/badge.json)](https://github.com/OWNER/REPO/blob/main/.certification/REPORT_CARD.md)

Click the badge β†’ full report card.

CI Integration

certify init generates GitHub Actions workflows:

  • PR β€” Certifies changed files, posts review summary
  • Nightly β€” Sweeps for expired certifications
  • Weekly β€” Full certification run + report card update

Quality Dimensions

Every code unit is scored across 9 quality dimensions:

Dimension What it measures
Correctness Lint errors, vet issues, test failures
Maintainability Cyclomatic complexity, function length
Readability Line length, documentation, TODO count
Testability Test coverage, test existence
Security Security-sensitive patterns
Architectural Fitness Package structure, dependency patterns
Operational Quality Git churn, contributor count
Performance Algorithmic complexity indicators
Change Risk Recent changes, author concentration

Dimensions are weighted and combined into a single score β†’ grade (A through F).


Certification Status

Certifications are time-bound β€” they expire by design.

Status Meaning
🟒 Certified Meets all required policies
🟑 Certified with Observations Acceptable but with minor issues
🟠 Probationary Requires improvement soon
πŸ”΄ Decertified Fails required policies
βšͺ Expired Certification window has elapsed, needs recertification
Exempt Explicitly excluded by human override

Default certification window: 90 days. Risk factors adjust the window β€” high churn shortens it, stable code extends it.


Commands

Command Description
certify init Bootstrap .certification/ with config and policies
certify scan Discover all certifiable code units
certify certify Evaluate, score, and certify units
certify report Generate report card and badge
certify expire Mark overdue certifications as expired
certify version Show version

Flags

certify certify --skip-agent         # deterministic only, no LLM review
certify certify --batch 20           # process 20 units at a time
certify certify --diff-base main     # only changed files (for PRs)
certify certify --target internal/   # scope to specific paths

certify report --format full         # complete report card (markdown)
certify report --format card         # terminal report card
certify report --format json         # machine-readable
certify report --badge               # print README badge snippet
certify report --output report.md    # write to file

Configuration

certify init creates .certification/config.yml:

mode: advisory        # advisory (report only) or enforcing (block on failure)

scope:
  include: []         # empty = everything
  exclude:
    - "vendor/**"
    - "node_modules/**"
    - "**/*_test.go"

expiry:
  default_window_days: 90

Policy Packs

Add YAML policy packs to .certification/policies/:

name: my-team-standards
version: "1.0.0"
language: go

rules:
  - id: no-todos
    dimension: readability
    description: "No TODO comments in certified code"
    severity: warning
    metric: todo_count
    threshold: 0

  - id: low-complexity
    dimension: maintainability
    description: "Cyclomatic complexity under 15"
    severity: error
    metric: cyclomatic_complexity
    threshold: 15

Agent-Assisted Review (Optional)

Certify auto-detects available AI providers and enables conservative review β€” no config changes needed:

Provider Detection Cost
OpenRouter OPENROUTER_API_KEY Free tier + paid
OpenAI OPENAI_API_KEY Paid (gpt-4o-mini ~$0.15/1M tokens)
Groq GROQ_API_KEY Free (30 req/min)
Ollama Auto-probe localhost:11434 Free (local)
LM Studio Auto-probe localhost:1234 Free (local)

Just set an env var or start a local server β€” Certify handles the rest.

For full control, explicitly configure in .certification/config.yml:

agent:
  enabled: true
  provider:
    type: openrouter
    api_key_env: OPENROUTER_API_KEY

Uses Apache 2.0 licensed models (Qwen, Mistral). Agent review supplements β€” it never overrides β€” deterministic evidence. Certify works fully without it.


Language Support

Language Adapter Discovery
Go Full Functions, methods, types via go/ast
TypeScript Basic Classes, functions, exports via regex
Everything else File-level One code unit per file

Repository Structure

.certification/
β”œβ”€β”€ config.yml          # configuration
β”œβ”€β”€ policies/           # policy packs
β”œβ”€β”€ records/            # per-unit certification records
β”œβ”€β”€ overrides/          # human governance overrides
β”œβ”€β”€ REPORT_CARD.md      # ← the report card
└── badge.json          # shields.io badge endpoint

Documentation


License

MIT

Directories ΒΆ

Path Synopsis
cmd
certify command
Package main is the entry point for the certify CLI.
Package main is the entry point for the certify CLI.
internal
agent
Package agent handles agent-assisted review via LLM providers.
Package agent handles agent-assisted review via LLM providers.
config
Package config handles loading and validation of certification configuration.
Package config handles loading and validation of certification configuration.
discovery
Package discovery handles code unit discovery and indexing.
Package discovery handles code unit discovery and indexing.
domain
Package domain defines the core types for the Code Certification System.
Package domain defines the core types for the Code Certification System.
engine
Package engine contains the certification scoring and status logic.
Package engine contains the certification scoring and status logic.
evidence
Package evidence handles evidence collection from various sources.
Package evidence handles evidence collection from various sources.
expiry
Package expiry computes certification expiry windows based on risk factors.
Package expiry computes certification expiry windows based on risk factors.
github
Package github handles GitHub integration (workflows, PR annotations, issues).
Package github handles GitHub integration (workflows, PR annotations, issues).
override
Package override handles loading and applying manual certification overrides.
Package override handles loading and applying manual certification overrides.
policy
Package policy handles policy matching and evaluation.
Package policy handles policy matching and evaluation.
queue
Package queue provides a persistent work queue for incremental certification.
Package queue provides a persistent work queue for incremental certification.
record
Package record handles persistence of certification records.
Package record handles persistence of certification records.
report
Package report generates certification reports from records.
Package report generates certification reports from records.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL