Skip to content

Metrics & Codes संदर्भ

harness-score जो कुछ भी रिपोर्ट करता है उसका संक्षिप्त संदर्भ: scores, scopes, levels, dimensions, check IDs, configuration keys, CLI flags, Action inputs, और JSON fields। Remediation recipes अध्याय 8 — मापन और सुधार में हैं।

स्कोर: maturity vs effective

Codeक्या शामिल हैउपयोग
maturityकेवल repository files (scopes: repo)Default CI gate, badge, --min-level, official team maturity
effectiveRepo ∪ configured global/extra scopesLocal: “इस मशीन पर agent को क्या दिखता है” जब user/system harness enabled हो

जब कोई extra scope configured नहीं, effective maturity के बराबर (same level, score, और checks)। Report हमेशा stable JSON के लिए दोनों blocks शामिल करता है।

CI में कौन-सा score gate करे, gate config में, --gate, या Action gate input से set करें (maturity default)।

स्कोप

Scopeअर्थक्या scan होता है
repoहमेशा onवह directory जो आप harness-score को pass करते हैं (default .)
userOpt-inAllowlisted paths repo-relative shapes में map: ~/.cursor/*, ~/.claude/*, ~/.codeium/windsurf/* (Windsurf alias), ~/Documents/Cline/Rules.clinerules/, ~/.continue/{rules,prompts}, ~/.agents/*, ~/.zed/commands, ~/.config/opencode/agents, आदि। multi-harness — user scope by tool देखें। शामिल नहीं: Copilot global (repo-only), Continue inline rules in config.yaml, IDE-only Cursor User Rules।
systemOpt-inValidated system-wide installs के लिए reserved (v1 में minimal)
extraRootsOpt-inAdditional directories (relative या absolute) जिनकी tree harness layout mirror करती है — जैसे shared team harness checkout

Conflict पर project files overlay paths पर जीतती हैं (same relative path)।

Scan नहीं: Cursor User Rules जो केवल IDE UI में हैं (disk पर नहीं), arbitrary home-directory walks, या evidence strings में secrets content।

स्तर (L0–L4)

Official level names maturity पर लागू, जब तक gate: effective set न करें।

LevelNameRequirements (सभी पिछले levels +)
L0Unharnessed
L1Documentedcontext ≥ 40%
L2Guidedcontext ≥ 60%; skills ≥ 30% या hooks ≥ 30%; hygiene ≥ 50%
L3Sensingsensors ≥ 60%; ci ≥ 50%
L4Self-correctinghooks ≥ 70%; total ≥ 80%

पूरी narrative: परिपक्वता मॉडल

आयाम

IDTitleMax ptsMeasures
contextContext & Guides20AGENTS.md, scoped rules, README
skillsSkills & Commands17Skills, commands/workflows, subagents
hooksHooks & Guardrails14hooks.json / Claude settings hooks
sensorsSensors & Feedback20Tests, linter, types, formatter
ciCI Feedback14Pipeline, pre-commit
hygieneHygiene & Safety23.gitignore, secrets, lockfile, license, MCP hygiene

Total: 108 points।

check कैटलॉग

Stable IDs — remediation से linked मापन और सुधार में।

Context & Guides

IDPtsAnalyzes exactlyRemediation
CTX-014Root AGENTS.md, CLAUDE.md, या GEMINI.md existsctx-01
CTX-023Context file में ≥20 meaningful lines और ≥2 headingsctx-02
CTX-034कम से कम एक scoped rule file (कोई supported tool) या nested context filectx-03
CTX-043हर rule frontmatter में activation metadata declare करती हैctx-04
CTX-052हर rule blanket always-on नहींctx-05
CTX-062कोई single rule file 500 lines से अधिक नहींctx-06
CTX-071Repository root पर README.mdctx-07
CTX-081Modern scoped rules के बिना legacy .cursorrules नहींctx-08

Skills & Commands

IDPtsAnalyzes exactlyRemediation
SKL-014Recognized skills directory के तहत कम से कम एक SKILL.mdskl-01
SKL-023हर skill के frontmatter में name: और description:skl-02
SKL-033किसी supported tool के लिए command/workflow files existskl-03
SKL-042Skill descriptions ≥40 charactersskl-04
AGT-013कम से कम एक subagent markdown fileagt-01
AGT-022हर subagent में name: और description: frontmatteragt-02

Hooks & Guardrails

IDPtsAnalyzes exactlyRemediation
HKS-014Hooks config exists और JSON के रूप में parse होता हैhks-01
HKS-022Events और typed handlers structurally valid हैं; unknown valid event warning देता हैhks-02
HKS-034Gate-class hook registered (shell/MCP/read/tool gate)hks-03
HKS-042Feedback-class hook registered (post-edit/tool)hks-04
HKS-052Executables और args का हर local path exists; non-command handlers N/A हैंhks-05

Sensors & Feedback

IDPtsAnalyzes exactlyRemediation
SNS-016Test runner configured (package.json script, pytest, go test, etc.)sns-01
SNS-025Linter configured (eslint, biome, ruff, golangci-lint, …)sns-02
SNS-034Type checking configured (tsconfig, mypy, pyright, …)sns-03
SNS-043Formatter configured (prettier, black, gofmt, …)sns-04
SNS-052Tree में कम से कम एक test file existssns-05

CI Feedback

IDPtsAnalyzes exactlyRemediation
CI-014CI pipeline file present (GitHub Actions, GitLab CI, …)ci-01
CI-024CI test suite चलाता हैci-02
CI-033CI lint या typecheck चलाता हैci-03
CI-043Pre-commit या git hook tooling installedci-04

Hygiene & Safety

IDPtsAnalyzes exactlyRemediation
HYG-012.gitignore presenthyg-01
HYG-023.gitignore environment files cover करता हैhyg-02
HYG-034Unprotected .env files नहीं (.env.example pattern के बिना)hyg-03
HYG-044MCP JSON configs में inline credential patterns नहींhyg-04
HYG-052LICENSE file presenthyg-05
HYG-062Harness markdown/JSON में credential-like signatures नहींhyg-06
HYG-073Dependency lockfile committedhyg-07
HYG-083MCP configs secrets के लिए env interpolation use करते हैंhyg-08

कॉन्फ़िगरेशन फ़ाइल (.harness-score.json)

Scan root पर optional JSON (strict schema — unknown keys error):

json
{
  "scopes": {
    "user": false,
    "system": false
  },
  "extraRoots": [
    { "id": "team-shared", "path": "../shared-harness" }
  ],
  "gate": "maturity",
  "extends": ["no-hooks"],
  "rules": {
    "HYG-05": "off"
  }
}
KeyTypeDefaultMeaning
scopes.userbooleanfalseUser-level harness overlay include करें
scopes.systembooleanfalseSystem-level overlay include करें
extraRoots{ id, path }[][]Effective में merge होने वाली extra harness trees
gate"maturity" | "effective""maturity"--min-level कौन-सा score use करता है
extendsstring[][]Apply करने के लिए named presets (नीचे देखें)
rulesRecord<checkId, severity>{}Per-check severity override, extends के हर preset के बाद apply होता है

Precedence: CLI flags → Action inputs → config file → defaultsextends/rules इस release में सिर्फ config-file तक सीमित हैं — अभी कोई --extends/--rule CLI flag या equivalent Action input नहीं है; इन्हें set करने वाली .harness-score.json की ओर point करने के लिए --config <path> use करें।

Team customization: extends और rules

यह vocabulary सीधे ESLint से लिया गया है, क्योंकि ज़्यादातर teams इसे पहले से जानती हैं:

  • rules किसी single check की severity को ID से override करता है: "HYG-05": "off"। इस release में severity "off" या "error""error" हर check का implicit default, और "off" check को उसकी dimension के score के numerator और denominator दोनों से हटा देता है (structurally excluded, कभी fail नहीं गिना जाता)। "warn" एक recognized पर आज जानबूझकर rejected value है, साफ़ "not supported yet" error के साथ — future advisory, non-blocking mode के लिए reserved।
  • extends maintainers द्वारा curate किया named preset apply करता है — rules overrides का versioned, PR-reviewed bundle, free-form per-repo exception नहीं। यह वही governance बनाए रखता है जो checks catalog को पहले से protect करती है: नया preset propose करना review से गुज़रता है (CONTRIBUTING.md देखें), silent local opt-out नहीं। extends में presets array क्रम में apply होते हैं, और rules की कोई explicit entry हमेशा preset पर prevail करती है।

extends/rules द्वारा excluded हर check हमेशा disclose होता है — terminal output में (Preset: ... line), Markdown report में (**Preset:** line और checks table में status), और --json के preset field में — कभी किसी flag के पीछे silently छुपा नहीं।

एक अपवाद, जानबूझकर: HYG-03, HYG-04, और HYG-06 — वे checks जो actively leaked या exposed credentials detect करते हैं — इन्हें rules या preset, किसी से भी कभी "off" set नहीं किया जा सकता। इस config format में बाकी सब कुछ disclosure और PR review पर integrity के लिए निर्भर है; ये तीन ही एकमात्र non-negotiable बिंदु हैं।

Built-in presets

Presetप्रभावक्यों
no-hooksHKS-01HKS-05 (पूरी Hooks & Guardrails dimension, 108 में से 14 points) को "off" set करता हैउन environments के लिए जहाँ local hook script execution policy से disallowed है — locked-down dev containers, regulated orgs, hooks install करने की permission-रहित shared runners। इन cases में guardrail केवल CI में लागू होता है।

पूरी dimension exclude करने का एक ईमानदार परिणाम है, जो पहले से जानना उपयोगी: चूंकि L4 · Self-correcting runtime guardrail hooks से defined है (देखें Maturity Model), no-hooks preset वाली repository कभी L4 तक नहीं पहुँचती — level capped बन जाता है, "fail" नहीं। report.level.capped true होता है और report.level.capReason वजह बताता है; बाकी हर dimension का score पूरी तरह अप्रभावित रहता है। यह scanner का "self-correcting" के अर्थ पर ईमानदार बने रहना है, hooks exclude करने की सज़ा नहीं।

CLI flags (स्कैन कॉन्फ़िगरेशन)

Repository maturity discovery पर production depth cap नहीं है। Known dependency और generated directories को छोड़ने के बाद इसमें tracked, untracked, और ignored files शामिल होते हैं। Repository scan में file-count-limit emergency 1,000,000-file fuse को दर्शाता है; bounded user और extra-root overlays अभी भी depth-limit report कर सकते हैं। Check के request करने पर inspect न हो पाने वाला discovered path unreadable-path report करता है; जानबूझकर skip किए गए 512 KiB से बड़े bodies यह reason report नहीं करते। Internal symlinks follow और deduplicate होते हैं; scan root के बाहर का target outside-root-symlink report करता है और उसे traverse या read नहीं किया जाता।

FlagMeaning
--config <file>Specific path से config load करें
--scope userUser scope enable (comma-separated: user, system)
--gate maturity|effective--min-level के लिए score
--min-level <0-4>Complete gated score level से नीचे हो तो exit 1; gate द्वारा चुना गया snapshot incomplete हो तो exit 2
--jsonFull report including scopes, gate, effective, और verdicts

GitHub Action इनपुट

InputDefaultMeaning
include-user-harnessfalse--scope user pass करता है
include-system-harnessfalse--scope system pass करता है
gatematurity--gate pass करता है
config''Set होने पर --config pass करता है
min-level0Gated score level से नीचे हो तो fail

Outputs: level, level-name, percent (maturity); effective-level, effective-percent. Action maturity complete होने पर ही maturity outputs, badge, और report publish करती है, और effective complete होने पर ही effective outputs publish करती है। अगर केवल effective incomplete है, तो gate: maturity warning के साथ pass हो सकता है; gate: effective exit 2 देता है। Maturity incomplete होने पर maturity outputs, badge, report, या PR comment publish नहीं होते।

Report JSON फ़ील्ड (स्थिर)

FieldDescription
rootAbsolute scan root
scopes.maturityहमेशा ["repo"]
scopes.effectiveजैसे ["repo"], ["repo","user"]
gate"maturity" या "effective"
resolvedRootsOverlays के लिए optional { scope, absPath } list
level, score, dimensions, checksMaturity snapshot
effectiveSame shape: { level, score, dimensions, checks, detectedHarnesses }
detectedHarnessesRepo में देखे गए tools (informational)
verdicts.maturity, verdicts.effectiveहर snapshot का completeness status और deterministic reasons: complete या incomplete
verdicts.*.reasons[]file-count-limit, depth-limit, unreadable-directory, unreadable-path, या outside-root-symlink, optional path और limit के साथ
truncatedCompatibility alias; maturity या effective snapshot के किसी कारण से incomplete होने पर true
preset{ extends, rules, resolved } — इस scan में actually apply हुई team customization; resolved सिर्फ वे checks list करता है जिनकी severity default से अलग है
level.capped, level.capReasonजब अगले level की कोई blocking requirement वर्तमान config में कभी पूरी नहीं हो सकती (जैसे उसकी dimension preset से excluded), तो capped true होता है; capReason वजह बताता है
dimensions[].applicablefalse सिर्फ तब जब उस dimension का हर check "off" resolve हुआ हो
checks[].severity"off" | "warn" | "error" — इस scan ने उस check के लिए जो resolved severity use की
checks[].warningsOptional non-fatal diagnostics { code, message, source? }; terminal और Markdown इन्हें points बदले बिना दिखाते हैं

level, score, dimensions, और checks diagnosis के लिए मौजूद रहते हैं, लेकिन संबंधित verdict incomplete होने पर provisional हैं। Terminal और Markdown unavailable snapshot को पहचानते हैं। Badge हमेशा maturity को दिखाता है और maturity incomplete होने पर incomplete value इस्तेमाल करता है, कभी L0-L4 नहीं। verdicts के बिना पुराने reports में truncated: false complete और truncated: true incomplete माना जाता है।

--diff default में maturity fields compare करता है (top-level level / score / checks) और incomplete maturity baseline या current result को reject करता है। Incomplete effective snapshot maturity diff को block नहीं करता।