@tduyng/pi-devos 0.0.0-stage → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1421 -0
- package/LICENSE +201 -0
- package/README.md +206 -2
- package/package.json +44 -4
- package/plugins/devos/agents/reader.md +27 -0
- package/plugins/devos/agents/verifier.md +155 -0
- package/plugins/devos/pi/extension/devos.ts +605 -0
- package/plugins/devos/scripts/check-evidence-router.sh +140 -0
- package/plugins/devos/scripts/evidence-router.py +254 -0
- package/plugins/devos/scripts/gates/check-dod-core.sh +285 -0
- package/plugins/devos/scripts/gates/check-dod.sh +38 -0
- package/plugins/devos/scripts/gates/check-implementation-boundary.sh +99 -0
- package/plugins/devos/scripts/gates/check-port-source.sh +134 -0
- package/plugins/devos/scripts/gates/check-report-locations.sh +148 -0
- package/plugins/devos/scripts/gates/check-scenario-coverage.sh +104 -0
- package/plugins/devos/scripts/gates/gate-check.mjs +204 -0
- package/plugins/devos/scripts/gates/phase-gate.sh +208 -0
- package/plugins/devos/scripts/gates/plan-template-check.py +141 -0
- package/plugins/devos/scripts/gates/run-gate.sh +148 -0
- package/plugins/devos/scripts/gates/spec-contract.sh +19 -0
- package/plugins/devos/scripts/gates/spec-template-check.py +152 -0
- package/plugins/devos/scripts/gates/suite/01-dod.sh +485 -0
- package/plugins/devos/scripts/gates/suite/02-integrity.sh +310 -0
- package/plugins/devos/scripts/gates/suite/03-archetype.sh +255 -0
- package/plugins/devos/scripts/gates/suite/04-spec-validator.sh +183 -0
- package/plugins/devos/scripts/gates/suite/05-requires.sh +360 -0
- package/plugins/devos/scripts/gates/suite/06-clarify-adapters.sh +435 -0
- package/plugins/devos/scripts/gates/suite/07-lint-evals.sh +350 -0
- package/plugins/devos/scripts/gates/suite/08-converge.sh +591 -0
- package/plugins/devos/scripts/gates/suite/09-quality.sh +516 -0
- package/plugins/devos/scripts/gates/suite/10-eval-harness.sh +679 -0
- package/plugins/devos/scripts/gates/test-gates.sh +76 -0
- package/plugins/devos/scripts/gates/test-integrity-rubric.sh +152 -0
- package/plugins/devos/scripts/gates/test-phase-gate.sh +116 -0
- package/plugins/devos/skills/absorb/SKILL.md +75 -0
- package/plugins/devos/skills/absorb/references/distill.md +67 -0
- package/plugins/devos/skills/absorb/scripts/check-refs.sh +108 -0
- package/plugins/devos/skills/absorb/scripts/knowledge.py +258 -0
- package/plugins/devos/skills/build/SKILL.md +71 -0
- package/plugins/devos/skills/build/references/advanced-routing.md +19 -0
- package/plugins/devos/skills/build/references/defect.md +17 -0
- package/plugins/devos/skills/build/references/exposure.md +28 -0
- package/plugins/devos/skills/build/references/hard.md +39 -0
- package/plugins/devos/skills/build/references/refactor.md +66 -0
- package/plugins/devos/skills/build/references/routes.md +56 -0
- package/plugins/devos/skills/build/references/scale.md +84 -0
- package/plugins/devos/skills/build/references/spike.md +19 -0
- package/plugins/devos/skills/build/scripts/construct-census.py +204 -0
- package/plugins/devos/skills/build/scripts/dep-order.py +297 -0
- package/plugins/devos/skills/build/scripts/ledger.sh +228 -0
- package/plugins/devos/skills/build/scripts/route.sh +5 -0
- package/plugins/devos/skills/build/scripts/secret-scan.sh +121 -0
- package/plugins/devos/skills/build/scripts/toolchain-preflight.py +302 -0
- package/plugins/devos/skills/frame/SKILL.md +54 -0
- package/plugins/devos/skills/frame/references/template.md +115 -0
- package/plugins/devos/skills/frame/scripts/survey.sh +44 -0
- package/plugins/devos/skills/implement/SKILL.md +36 -0
- package/plugins/devos/skills/implement/references/conditional-plan.md +17 -0
- package/plugins/devos/skills/implement/references/debug-loop.md +7 -0
- package/plugins/devos/skills/implement/references/dod.md +37 -0
- package/plugins/devos/skills/implement/references/implement.md +54 -0
- package/plugins/devos/skills/implement/references/manual-gates.md +16 -0
- package/plugins/devos/skills/implement/references/plan.md +142 -0
- package/plugins/devos/skills/implement/references/resume.md +9 -0
- package/plugins/devos/skills/implement/references/scale.md +86 -0
- package/plugins/devos/skills/implement/references/verify-close.md +62 -0
- package/plugins/devos/skills/implement/references/visual-verification.md +7 -0
- package/plugins/devos/skills/implement/scripts/check-converge.sh +147 -0
- package/plugins/devos/skills/implement/scripts/equivalence-check.sh +140 -0
- package/plugins/devos/skills/implement/scripts/manifest-queue.sh +185 -0
- package/plugins/devos/skills/implement/scripts/ops-log.sh +58 -0
- package/plugins/devos/skills/implement/scripts/pilot-consistency.py +173 -0
- package/plugins/devos/skills/implement/scripts/validate-spec.sh +220 -0
- package/plugins/devos/skills/init/SKILL.md +100 -0
- package/plugins/devos/skills/init/references/archetype-sections.md +15 -0
- package/plugins/devos/skills/init/references/context.md +42 -0
- package/plugins/devos/skills/init/references/conventions-template.md +153 -0
- package/plugins/devos/skills/init/references/reverse-engineer.md +3 -0
- package/plugins/devos/skills/init/references/rule-format.md +58 -0
- package/plugins/devos/skills/init/references/shape-model.md +29 -0
- package/plugins/devos/skills/init/scripts/detect-archetype.py +461 -0
- package/plugins/devos/skills/init/scripts/render-rule.py +114 -0
- package/plugins/devos/skills/init/scripts/reverse-engineer.sh +162 -0
- package/plugins/devos/skills/learn/SKILL.md +29 -0
- package/plugins/devos/skills/learn/references/destinations.md +43 -0
- package/plugins/devos/skills/learn/references/scoring.md +26 -0
- package/plugins/devos/skills/review/SKILL.md +54 -0
- package/plugins/devos/skills/review/references/comments.md +13 -0
- package/plugins/devos/skills/review/references/gaps.md +26 -0
- package/plugins/devos/skills/review/references/reviewer.md +124 -0
- package/plugins/devos/skills/review/references/routing.md +35 -0
- package/plugins/devos/skills/review/scripts/__pycache__/prepare.cpython-313.pyc +0 -0
- package/plugins/devos/skills/review/scripts/prepare.py +763 -0
- package/plugins/devos/skills/spec/SKILL.md +57 -0
- package/plugins/devos/skills/spec/references/prototype.md +21 -0
- package/plugins/devos/skills/spec/references/question-craft.md +47 -0
- package/plugins/devos/skills/spec/references/roadmap-link.md +5 -0
- package/plugins/devos/skills/spec/references/write-spec.md +128 -0
- package/plugins/devos/skills/spec/scripts/clarify.sh +173 -0
- package/plugins/devos/skills/status/SKILL.md +67 -0
- package/plugins/devos/skills/status/references/cost.md +38 -0
- package/plugins/devos/skills/status/scripts/artifact-budgets.sh +88 -0
- package/plugins/devos/skills/status/scripts/check-requires.py +556 -0
- package/plugins/devos/skills/status/scripts/context-cost.sh +89 -0
- package/plugins/devos/skills/status/scripts/convention-usage.sh +184 -0
- package/plugins/devos/skills/status/scripts/findings-summary.sh +112 -0
- package/plugins/devos/skills/status/scripts/quality-correlation.sh +259 -0
- package/plugins/devos/skills/status/scripts/sizing-calibration.sh +71 -0
- package/plugins/devos/skills/status/scripts/spec-diff.sh +137 -0
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# convention-usage.sh: which conventions.md entries archived capsules actually
|
|
3
|
+
# exercised. Zero model calls, grep and sed only.
|
|
4
|
+
#
|
|
5
|
+
# Why this exists: DevOS can add to conventions.md forever and has no signal
|
|
6
|
+
# for removing anything, so the file only grows and every plan-time read pays
|
|
7
|
+
# for the dead entries. A convention that mattered got embedded into a spec.md
|
|
8
|
+
# capsule at plan time. That embedding is the usage record, already on disk.
|
|
9
|
+
#
|
|
10
|
+
# What it can and cannot see. Capsules paraphrase conventions, they do not quote
|
|
11
|
+
# them, so matching bullet text is hopeless. What survives paraphrase is the
|
|
12
|
+
# identifiers: a convention about test-gates.sh says "test-gates.sh" and so does
|
|
13
|
+
# the capsule that obeyed it. So each entry is keyed on its backticked
|
|
14
|
+
# file/path-shaped spans, and an entry with none of those cannot be measured
|
|
15
|
+
# this way at all. Those are reported as UNMEASURABLE, never as unused: a
|
|
16
|
+
# prose-only convention ("one logical change per commit") is invisible here and
|
|
17
|
+
# saying nothing about it is the honest output.
|
|
18
|
+
#
|
|
19
|
+
# CITED an identifier of this entry appears in >=1 archived capsule
|
|
20
|
+
# UNCITED it has identifiers and none appear in any capsule
|
|
21
|
+
# UNMEASURABLE no file/path-shaped identifier to key on
|
|
22
|
+
#
|
|
23
|
+
# UNCITED is a prompt to re-read the entry, never an instruction to delete it.
|
|
24
|
+
# A convention can be load-bearing precisely because it is always obeyed and
|
|
25
|
+
# therefore never discussed. Exit is always 0: this reports, it does not gate.
|
|
26
|
+
#
|
|
27
|
+
# Below MIN_CAPSULES archived capsules the ratio means nothing and the script
|
|
28
|
+
# says INSUFFICIENT DATA instead of guessing (same floor and same wording as
|
|
29
|
+
# quality-correlation.sh).
|
|
30
|
+
set -u
|
|
31
|
+
|
|
32
|
+
MIN_CAPSULES=5
|
|
33
|
+
|
|
34
|
+
REPO_DIR="${1:-.}"
|
|
35
|
+
cd "$REPO_DIR" || { echo "FAIL convention-usage: no such directory: $REPO_DIR" >&2; exit 1; }
|
|
36
|
+
|
|
37
|
+
CONVENTIONS="devos/standards/conventions.md"
|
|
38
|
+
ARCHIVE_DIR="devos/specs/archive"
|
|
39
|
+
|
|
40
|
+
if [[ ! -f "$CONVENTIONS" ]]; then
|
|
41
|
+
echo "No $CONVENTIONS yet (nothing onboarded)."
|
|
42
|
+
exit 0
|
|
43
|
+
fi
|
|
44
|
+
|
|
45
|
+
capsules=$(find "$ARCHIVE_DIR" -mindepth 2 -maxdepth 2 -name 'spec.md' 2>/dev/null | sort)
|
|
46
|
+
capsule_count=$(printf '%s' "$capsules" | grep -c . || true)
|
|
47
|
+
|
|
48
|
+
echo "# Convention Usage"
|
|
49
|
+
echo ""
|
|
50
|
+
|
|
51
|
+
if [[ "$capsule_count" -lt "$MIN_CAPSULES" ]]; then
|
|
52
|
+
echo "INSUFFICIENT DATA: only $capsule_count archived capsule(s) found (need at least $MIN_CAPSULES)"
|
|
53
|
+
exit 0
|
|
54
|
+
fi
|
|
55
|
+
|
|
56
|
+
echo "Source: $capsule_count archived capsule(s) in $ARCHIVE_DIR"
|
|
57
|
+
echo ""
|
|
58
|
+
|
|
59
|
+
# One haystack for every capsule; each entry is tested against all of them.
|
|
60
|
+
# Read the paths one line at a time rather than handing them to cat as one
|
|
61
|
+
# word-split argument list. A spec name is a free-form slug, so a directory may
|
|
62
|
+
# contain a space, and the unquoted form then split the path into two arguments
|
|
63
|
+
# that both failed to open, with stderr discarded: the capsule was dropped from
|
|
64
|
+
# the search and every entry only it mentioned came out UNCITED.
|
|
65
|
+
haystack=$(while IFS= read -r capsule; do
|
|
66
|
+
[[ -n "$capsule" ]] && cat -- "$capsule"
|
|
67
|
+
done <<<"$capsules" 2>/dev/null)
|
|
68
|
+
|
|
69
|
+
cited=0 uncited=0 unmeasurable=0
|
|
70
|
+
loose_rows="" uncited_rows=""
|
|
71
|
+
section=""
|
|
72
|
+
|
|
73
|
+
while IFS= read -r line || [[ -n "$line" ]]; do
|
|
74
|
+
# Track the nearest heading so a row can say where the entry lives.
|
|
75
|
+
if [[ "$line" =~ ^##[[:space:]]+(.*) ]]; then
|
|
76
|
+
section="${BASH_REMATCH[1]}"
|
|
77
|
+
continue
|
|
78
|
+
fi
|
|
79
|
+
# Only top-level bullets are entries; continuation lines belong to the one
|
|
80
|
+
# above. Both markdown bullet markers count: a convention written `* foo`
|
|
81
|
+
# is the same entry as one written `- foo`, and matching only the dash
|
|
82
|
+
# dropped it from every class and from the total, so a file with two
|
|
83
|
+
# entries reported one.
|
|
84
|
+
if [[ "$line" =~ ^-[[:space:]]+ ]]; then
|
|
85
|
+
entry="${line#- }"
|
|
86
|
+
elif [[ "$line" =~ ^\*[[:space:]]+ ]]; then
|
|
87
|
+
entry="${line#\* }"
|
|
88
|
+
else
|
|
89
|
+
continue
|
|
90
|
+
fi
|
|
91
|
+
# Backticked spans that look like a file or a path: foo.sh, a/b, dir/f.md.
|
|
92
|
+
ids=$(grep -o '`[^`]*`' <<<"$entry" 2>/dev/null \
|
|
93
|
+
| tr -d '`' \
|
|
94
|
+
| grep -oE '[A-Za-z0-9_.-]+/[A-Za-z0-9_./-]+|[A-Za-z0-9_-]+\.[A-Za-z]{1,4}' \
|
|
95
|
+
| sort -u)
|
|
96
|
+
|
|
97
|
+
# Label: the entry's first 60 chars, backticks and pipes stripped so the
|
|
98
|
+
# markdown table cannot be broken by the content it quotes.
|
|
99
|
+
label=$(printf '%s' "$entry" | tr -d '`|' | cut -c1-60)
|
|
100
|
+
|
|
101
|
+
if [[ -z "$ids" ]]; then
|
|
102
|
+
unmeasurable=$((unmeasurable + 1))
|
|
103
|
+
continue
|
|
104
|
+
fi
|
|
105
|
+
|
|
106
|
+
# Two passes, strongest first. A convention naming a full path is satisfied
|
|
107
|
+
# by a capsule that mentions only the file, so the basename is a legitimate
|
|
108
|
+
# fallback — but a generic basename would match every capsule and report a
|
|
109
|
+
# dead convention as live, so those are skipped and the match kind is shown.
|
|
110
|
+
hit="" hit_kind=""
|
|
111
|
+
while IFS= read -r id; do
|
|
112
|
+
[[ -n "$id" ]] || continue
|
|
113
|
+
if grep -qF -- "$id" <<<"$haystack"; then
|
|
114
|
+
hit="$id" hit_kind="path"
|
|
115
|
+
break
|
|
116
|
+
fi
|
|
117
|
+
done <<<"$ids"
|
|
118
|
+
|
|
119
|
+
if [[ -z "$hit" ]]; then
|
|
120
|
+
while IFS= read -r id; do
|
|
121
|
+
[[ "$id" == */* ]] || continue
|
|
122
|
+
base="${id##*/}"
|
|
123
|
+
[[ "${#base}" -ge 6 ]] || continue
|
|
124
|
+
case "$base" in
|
|
125
|
+
spec.md | notes.md | index.* | README.md | AGENTS.md | \
|
|
126
|
+
decisions.md | conventions.md | domain-model.md | package.json | \
|
|
127
|
+
verification.md) continue ;;
|
|
128
|
+
esac
|
|
129
|
+
if grep -qF -- "$base" <<<"$haystack"; then
|
|
130
|
+
hit="$base" hit_kind="name"
|
|
131
|
+
break
|
|
132
|
+
fi
|
|
133
|
+
done <<<"$ids"
|
|
134
|
+
fi
|
|
135
|
+
|
|
136
|
+
if [[ -n "$hit" ]]; then
|
|
137
|
+
cited=$((cited + 1))
|
|
138
|
+
# Only the basename matches are listed: a full-path hit is unambiguous,
|
|
139
|
+
# a basename hit is the one a reader may want to sanity-check.
|
|
140
|
+
[[ "$hit_kind" == "name" ]] &&
|
|
141
|
+
loose_rows="${loose_rows}| ${section} | ${label} | ${hit} |"$'\n'
|
|
142
|
+
else
|
|
143
|
+
uncited=$((uncited + 1))
|
|
144
|
+
first_id=$(head -1 <<<"$ids")
|
|
145
|
+
uncited_rows="${uncited_rows}| ${section} | ${label} | ${first_id} |"$'\n'
|
|
146
|
+
fi
|
|
147
|
+
done <"$CONVENTIONS"
|
|
148
|
+
|
|
149
|
+
total=$((cited + uncited + unmeasurable))
|
|
150
|
+
echo "| Class | Entries |"
|
|
151
|
+
echo "|---|---|"
|
|
152
|
+
echo "| CITED | $cited |"
|
|
153
|
+
echo "| UNCITED | $uncited |"
|
|
154
|
+
echo "| UNMEASURABLE | $unmeasurable |"
|
|
155
|
+
echo "| Total entries | $total |"
|
|
156
|
+
echo ""
|
|
157
|
+
|
|
158
|
+
if [[ "$uncited" -gt 0 ]]; then
|
|
159
|
+
echo "## UNCITED"
|
|
160
|
+
echo ""
|
|
161
|
+
echo "No capsule mentions these entries' identifiers. Re-read each one: still true and"
|
|
162
|
+
echo "load-bearing, or a leftover the map or a scoped rule now covers?"
|
|
163
|
+
echo ""
|
|
164
|
+
echo "| Section | Entry | Looked for |"
|
|
165
|
+
echo "|---|---|---|"
|
|
166
|
+
printf '%s' "$uncited_rows"
|
|
167
|
+
echo ""
|
|
168
|
+
fi
|
|
169
|
+
|
|
170
|
+
if [[ -n "$loose_rows" ]]; then
|
|
171
|
+
echo "## CITED by filename only"
|
|
172
|
+
echo ""
|
|
173
|
+
echo "Matched on the basename, not the full path the entry names. Worth a glance:"
|
|
174
|
+
echo "a common filename can match a capsule that had nothing to do with this entry."
|
|
175
|
+
echo ""
|
|
176
|
+
echo "| Section | Entry | Matched |"
|
|
177
|
+
echo "|---|---|---|"
|
|
178
|
+
printf '%s' "$loose_rows"
|
|
179
|
+
echo ""
|
|
180
|
+
fi
|
|
181
|
+
|
|
182
|
+
if [[ "$unmeasurable" -gt 0 ]]; then
|
|
183
|
+
echo "$unmeasurable entry(s) carry no file-shaped identifier and were not assessed."
|
|
184
|
+
fi
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Findings summary: reads devos/deferred.md and reports statistics.
|
|
3
|
+
# Deterministic, zero model calls.
|
|
4
|
+
#
|
|
5
|
+
# Reports: total specs completed, total findings, findings by severity,
|
|
6
|
+
# findings by resolution type, trend over time (finding count per month),
|
|
7
|
+
# and how often the zero-findings rule triggered.
|
|
8
|
+
#
|
|
9
|
+
# Usage: findings-summary.sh [project-root]
|
|
10
|
+
# project-root defaults to pwd (the user's project directory).
|
|
11
|
+
set -u
|
|
12
|
+
PROJECT_ROOT="${1:-$(pwd)}"
|
|
13
|
+
DEFERRED="$PROJECT_ROOT/devos/deferred.md"
|
|
14
|
+
|
|
15
|
+
if [[ ! -f "$DEFERRED" ]] || [[ ! -s "$DEFERRED" ]]; then
|
|
16
|
+
echo "No findings data yet — no specs have completed this session."
|
|
17
|
+
exit 0
|
|
18
|
+
fi
|
|
19
|
+
|
|
20
|
+
# A ledger is append-only, but it may also contain a heading, blank lines, or
|
|
21
|
+
# explanatory prose. Count records only. The documented record shape is a
|
|
22
|
+
# bracketed spec/date, a bracketed severity, and one of the four resolutions,
|
|
23
|
+
# with or without brackets around the resolution.
|
|
24
|
+
FINDING_RE='^[[:space:]]*(-[[:space:]]*|\*[[:space:]]*)?\[[^]]+\][[:space:]]+\[[[:space:]]*(critical|warning|suggestion)\][[:space:]]+\[?(patch|spec-amendment|defer|reject)\]?[[:space:]]*:'
|
|
25
|
+
records=$(grep -E "$FINDING_RE" "$DEFERRED" 2>/dev/null || true)
|
|
26
|
+
|
|
27
|
+
severity_count() {
|
|
28
|
+
printf '%s\n' "$records" | grep -Ec "\\][[:space:]]+\\[$1\\]" 2>/dev/null || true
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
resolution_count() {
|
|
32
|
+
printf '%s\n' "$records" | grep -Ec "\\[[[:space:]]*(critical|warning|suggestion)\\][[:space:]]+\\[?$1\\]?[[:space:]]*:" 2>/dev/null || true
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
total=$(printf '%s\n' "$records" | awk 'NF { n++ } END { print n + 0 }')
|
|
36
|
+
critical=$(severity_count critical)
|
|
37
|
+
warning=$(severity_count warning)
|
|
38
|
+
suggestion=$(severity_count suggestion)
|
|
39
|
+
patch=$(resolution_count patch)
|
|
40
|
+
spec_amend=$(resolution_count spec-amendment)
|
|
41
|
+
defer=$(resolution_count defer)
|
|
42
|
+
reject=$(resolution_count reject)
|
|
43
|
+
|
|
44
|
+
echo "Findings summary from devos/deferred.md:"
|
|
45
|
+
echo "| Metric | Count |"
|
|
46
|
+
echo "|---|---|"
|
|
47
|
+
echo "| Total findings | $total |"
|
|
48
|
+
echo "| By severity: critical | $critical |"
|
|
49
|
+
echo "| By severity: warning | $warning |"
|
|
50
|
+
echo "| By severity: suggestion | $suggestion |"
|
|
51
|
+
echo "| By resolution: patch | $patch |"
|
|
52
|
+
echo "| By resolution: spec-amendment | $spec_amend |"
|
|
53
|
+
echo "| By resolution: defer | $defer |"
|
|
54
|
+
echo "| By resolution: reject | $reject |"
|
|
55
|
+
|
|
56
|
+
# Trend: finding count per month (from filename dates in the log entries if present, otherwise from file mtime)
|
|
57
|
+
echo ""
|
|
58
|
+
echo "Trend (findings per month):"
|
|
59
|
+
# The month comes from the record's leading bracketed field only. Scanning the
|
|
60
|
+
# whole record also matched months named in the message, so one January finding
|
|
61
|
+
# that mentions an earlier month was reported under both.
|
|
62
|
+
monthly=$(printf '%s\n' "$records" | sed -nE 's/^[[:space:]]*(-[[:space:]]*|\*[[:space:]]*)?\[([^]]+)\].*/\2/p' \
|
|
63
|
+
| grep -oE '^[0-9]{4}-[0-9]{2}' 2>/dev/null | sort | uniq -c | sort -r)
|
|
64
|
+
if [[ -n "$monthly" ]]; then
|
|
65
|
+
while IFS=' ' read -r count month; do
|
|
66
|
+
echo " $month: $count findings"
|
|
67
|
+
done <<<"$monthly"
|
|
68
|
+
else
|
|
69
|
+
# Fall back to file modification time grouping
|
|
70
|
+
echo " No date stamps in deferred.md entries; trend data unavailable."
|
|
71
|
+
fi
|
|
72
|
+
|
|
73
|
+
# Zero findings rule measurement: count L-route specs whose deferred entry says
|
|
74
|
+
# "zero findings on first run".
|
|
75
|
+
#
|
|
76
|
+
# Count specs, not ledger lines. Two findings for one spec are still one spec,
|
|
77
|
+
# and the denominator is completed specs, so counting records here produced
|
|
78
|
+
# "3 of 2 completed specs": a ratio no set of specs can have. The route filter
|
|
79
|
+
# the sentence already claims is applied here too, read from the spec's own
|
|
80
|
+
# archived .quality.md row, so an M-route spec cannot inflate an L-only rule.
|
|
81
|
+
archive_dir="$(dirname "$DEFERRED")/specs/archive"
|
|
82
|
+
zero_findings=0
|
|
83
|
+
zero_seen=""
|
|
84
|
+
while IFS= read -r rec; do
|
|
85
|
+
[[ -n "$rec" ]] || continue
|
|
86
|
+
rec_spec=$(printf '%s' "$rec" | sed -nE 's/^[[:space:]]*[-*][[:space:]]*\[([^]]+)\].*/\1/p')
|
|
87
|
+
[[ -n "$rec_spec" ]] || continue
|
|
88
|
+
# The rule measures a clean first pass, so the record has to say so. A
|
|
89
|
+
# message that merely mentions an absence ("no findings were observed") is
|
|
90
|
+
# prose about the run, not a claim that the first pass came back clean, and
|
|
91
|
+
# counting it turned an absence into a measurement.
|
|
92
|
+
printf '%s' "$rec" | grep -qiE 'first[[:space:]]+(run|pass|attempt|try)' || continue
|
|
93
|
+
case " $zero_seen " in *" $rec_spec "*) continue ;; esac
|
|
94
|
+
qrow="$archive_dir/$rec_spec.quality.md"
|
|
95
|
+
[[ -f "$qrow" ]] || continue
|
|
96
|
+
rec_route=$(awk -F'\t' 'NF >= 2 { print toupper($2); exit }' "$qrow" 2>/dev/null)
|
|
97
|
+
[[ "$rec_route" == "L" ]] || continue
|
|
98
|
+
zero_seen="$zero_seen $rec_spec"
|
|
99
|
+
zero_findings=$((zero_findings + 1))
|
|
100
|
+
done < <(printf '%s\n' "$records" | grep -iE 'zero.*findings|no findings' 2>/dev/null || true)
|
|
101
|
+
# Denominator is archived specs, not findings. $total counts parsed records, so
|
|
102
|
+
# reporting "N of $total completed specs" cannot mistake ledger lines for specs.
|
|
103
|
+
specs=0
|
|
104
|
+
[[ -d "$archive_dir" ]] && specs=$(find "$archive_dir" -mindepth 1 -maxdepth 1 -type d 2>/dev/null | wc -l | tr -d ' ')
|
|
105
|
+
echo ""
|
|
106
|
+
if ((specs > 0)); then
|
|
107
|
+
echo "Zero-findings rule: $zero_findings of $specs completed specs triggered a re-run (zero findings on first pass)."
|
|
108
|
+
else
|
|
109
|
+
echo "Zero-findings rule: no completed specs to measure."
|
|
110
|
+
fi
|
|
111
|
+
|
|
112
|
+
exit 0
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# quality-correlation.sh: reads tab-separated .quality.md files from devos/specs/archive/,
|
|
3
|
+
# prints findings-per-route averages and an S/M/L routing confusion matrix.
|
|
4
|
+
# Pure awk, zero model calls.
|
|
5
|
+
#
|
|
6
|
+
# .quality.md format (tab-separated):
|
|
7
|
+
# spec-name route validate-pass finding-count severity dod-pass [triage-loops] [audit-hits] [understanding]
|
|
8
|
+
# route: S|M|L|C
|
|
9
|
+
# validate-pass: yes|no
|
|
10
|
+
# finding-count: integer
|
|
11
|
+
# severity: none|suggestion|warning|critical
|
|
12
|
+
# dod-pass: yes|no
|
|
13
|
+
# triage-loops: integer, or ? when the row predates the column
|
|
14
|
+
# audit-hits: hits/findings (e.g. 2/5), -/0 when the audit was clean,
|
|
15
|
+
# ?/N when the row predates the column and only N is known
|
|
16
|
+
# understanding: debt, explained, or -. No longer written, still validated
|
|
17
|
+
# on legacy rows.
|
|
18
|
+
#
|
|
19
|
+
# Columns 7, 8 and 9 are optional: rows written before they existed are shorter
|
|
20
|
+
# and are counted for everything the first six answer. An unknown value is
|
|
21
|
+
# excluded from its average rather than read as zero, which is the difference
|
|
22
|
+
# between "we did not measure this" and "this measured zero".
|
|
23
|
+
set -u
|
|
24
|
+
|
|
25
|
+
REPO_DIR="${1:-.}"
|
|
26
|
+
cd "$REPO_DIR" || { echo "FAIL quality-correlation: no such directory: $REPO_DIR" >&2; exit 1; }
|
|
27
|
+
|
|
28
|
+
QUALITY_DIR="devos/specs/archive"
|
|
29
|
+
if [[ ! -d "$QUALITY_DIR" ]]; then
|
|
30
|
+
echo "INSUFFICIENT DATA: $QUALITY_DIR does not exist"
|
|
31
|
+
exit 0
|
|
32
|
+
fi
|
|
33
|
+
|
|
34
|
+
# Count files, non-empty rows, and rows the parser can actually use. The
|
|
35
|
+
# report denominator must match the parser, not the number of files on disk.
|
|
36
|
+
file_count=$(find "$QUALITY_DIR" -name '*.quality.md' 2>/dev/null | wc -l | tr -d ' ')
|
|
37
|
+
row_count=$(find "$QUALITY_DIR" -name '*.quality.md' -exec awk 'NF { n++ } END { print n + 0 }' {} +)
|
|
38
|
+
valid_count=$(find "$QUALITY_DIR" -name '*.quality.md' -exec awk -F '\t' 'NF >= 6 && $3 ~ /^(yes|no)$/ && $4 ~ /^[0-9]+$/ && $5 ~ /^(none|suggestion|warning|critical)$/ && $6 ~ /^(yes|no)$/ && (NF < 9 || $9 ~ /^(debt|explained|-)$/) { n++ } END { print n + 0 }' {} +)
|
|
39
|
+
invalid_finding_count=$(find "$QUALITY_DIR" -name '*.quality.md' -exec awk -F '\t' 'NF >= 6 && $4 !~ /^[0-9]+$/ { n++ } END { print n + 0 }' {} +)
|
|
40
|
+
invalid_validate_count=$(find "$QUALITY_DIR" -name '*.quality.md' -exec awk -F '\t' 'NF >= 6 && $3 !~ /^(yes|no)$/ { n++ } END { print n + 0 }' {} +)
|
|
41
|
+
invalid_severity_count=$(find "$QUALITY_DIR" -name '*.quality.md' -exec awk -F '\t' 'NF >= 6 && $5 !~ /^(none|suggestion|warning|critical)$/ { n++ } END { print n + 0 }' {} +)
|
|
42
|
+
invalid_dod_count=$(find "$QUALITY_DIR" -name '*.quality.md' -exec awk -F '\t' 'NF >= 6 && $6 !~ /^(yes|no)$/ { n++ } END { print n + 0 }' {} +)
|
|
43
|
+
invalid_understanding_count=$(find "$QUALITY_DIR" -name '*.quality.md' -exec awk -F '\t' 'NF >= 9 && $9 !~ /^(debt|explained|-)$/ { n++ } END { print n + 0 }' {} +)
|
|
44
|
+
invalid_triage_count=$(find "$QUALITY_DIR" -name '*.quality.md' -exec awk -F '\t' 'NF >= 7 && $7 !~ /^([0-9]+|\?)$/ { n++ } END { print n + 0 }' {} +)
|
|
45
|
+
row_count=${row_count:-0}
|
|
46
|
+
valid_count=${valid_count:-0}
|
|
47
|
+
invalid_finding_count=${invalid_finding_count:-0}
|
|
48
|
+
invalid_validate_count=${invalid_validate_count:-0}
|
|
49
|
+
invalid_severity_count=${invalid_severity_count:-0}
|
|
50
|
+
invalid_dod_count=${invalid_dod_count:-0}
|
|
51
|
+
invalid_understanding_count=${invalid_understanding_count:-0}
|
|
52
|
+
invalid_triage_count=${invalid_triage_count:-0}
|
|
53
|
+
skipped_count=$(find "$QUALITY_DIR" -name '*.quality.md' 2>/dev/null -exec awk -F '\t' 'NF && NF < 6 { n++ } END { print n + 0 }' {} +)
|
|
54
|
+
skipped_count=${skipped_count:-0}
|
|
55
|
+
|
|
56
|
+
if [[ "$valid_count" -lt 5 ]]; then
|
|
57
|
+
echo "INSUFFICIENT DATA: only $valid_count valid quality rows found (need at least 5)"
|
|
58
|
+
exit 0
|
|
59
|
+
fi
|
|
60
|
+
|
|
61
|
+
echo "# Quality Correlation Report"
|
|
62
|
+
echo ""
|
|
63
|
+
echo "Source: $QUALITY_DIR"
|
|
64
|
+
echo "Quality files: $file_count"
|
|
65
|
+
echo "Specs analyzed: $valid_count"
|
|
66
|
+
if [[ "$skipped_count" -gt 0 ]]; then
|
|
67
|
+
echo "Skipped quality rows: $skipped_count (fewer than 6 tab-separated fields)"
|
|
68
|
+
fi
|
|
69
|
+
echo ""
|
|
70
|
+
|
|
71
|
+
# Parse tab-separated quality files.
|
|
72
|
+
find "$QUALITY_DIR" -name '*.quality.md' 2>/dev/null -exec awk -v invalid_finding_count="$invalid_finding_count" -v invalid_validate_count="$invalid_validate_count" -v invalid_severity_count="$invalid_severity_count" -v invalid_dod_count="$invalid_dod_count" -v invalid_understanding_count="$invalid_understanding_count" -v invalid_triage_count="$invalid_triage_count" -F'\t' '
|
|
73
|
+
BEGIN {
|
|
74
|
+
route_n = split("S M L C ?", rr, " ")
|
|
75
|
+
for (i = 1; i <= route_n; i++) {
|
|
76
|
+
route_total[rr[i]] = 0; route_count[rr[i]] = 0
|
|
77
|
+
high_sev_by_route[rr[i]] = 0; zero_by_route[rr[i]] = 0
|
|
78
|
+
loop_total[rr[i]] = 0; loop_count[rr[i]] = 0
|
|
79
|
+
}
|
|
80
|
+
total_findings = 0
|
|
81
|
+
total_specs = 0
|
|
82
|
+
audit_hits = 0; audit_found = 0; audit_rows = 0; audit_unknown = 0; audit_invalid = 0
|
|
83
|
+
}
|
|
84
|
+
{
|
|
85
|
+
if (NF < 6) next
|
|
86
|
+
if ($3 !~ /^(yes|no)$/ || $4 !~ /^[0-9]+$/ || $5 !~ /^(none|suggestion|warning|critical)$/ || $6 !~ /^(yes|no)$/ || (NF >= 9 && $9 !~ /^(debt|explained|-)$/)) next
|
|
87
|
+
route = toupper($2)
|
|
88
|
+
# An unrecognized route is reported as "?", never folded into M: silently
|
|
89
|
+
# defaulting is what hid the producer bug that recorded M for every spec
|
|
90
|
+
#, because the wrong value read as a legitimate one.
|
|
91
|
+
if (route != "S" && route != "M" && route != "L" && route != "C") route = "?"
|
|
92
|
+
findings = $4 + 0
|
|
93
|
+
severity = $5
|
|
94
|
+
|
|
95
|
+
route_total[route] += findings
|
|
96
|
+
route_count[route]++
|
|
97
|
+
total_findings += findings
|
|
98
|
+
total_specs++
|
|
99
|
+
|
|
100
|
+
# Track high-severity findings per route (confusion matrix signals).
|
|
101
|
+
if (severity == "critical" || severity == "warning") {
|
|
102
|
+
high_sev_by_route[route]++
|
|
103
|
+
}
|
|
104
|
+
if (findings == 0) {
|
|
105
|
+
zero_by_route[route]++
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
# Triage loops (column 7). A "?" row predates the column: excluded from the
|
|
109
|
+
# average rather than counted as 0, which would read as a first-pass clean.
|
|
110
|
+
if (NF >= 7 && $7 ~ /^[0-9]+$/) {
|
|
111
|
+
loop_total[route] += $7 + 0
|
|
112
|
+
loop_count[route]++
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
# Audit hit rate (column 8), written hits/findings. "-" means the audit was
|
|
116
|
+
# clean, so there was nothing to hit; "?" means nobody recorded the hits.
|
|
117
|
+
if (NF >= 8 && $8 ~ /\//) {
|
|
118
|
+
audit_parts = split($8, a, "/")
|
|
119
|
+
if (audit_parts != 2) {
|
|
120
|
+
audit_invalid++
|
|
121
|
+
} else if (a[1] == "?" && a[2] ~ /^[0-9]+$/) {
|
|
122
|
+
found = a[2] + 0
|
|
123
|
+
if (found > 0) audit_unknown++
|
|
124
|
+
} else if (a[1] == "-" && a[2] == "0") {
|
|
125
|
+
audit_rows++
|
|
126
|
+
} else if (a[1] ~ /^[0-9]+$/ && a[2] ~ /^[0-9]+$/) {
|
|
127
|
+
if ((a[2] + 0) > 0 && (a[1] + 0) <= (a[2] + 0)) {
|
|
128
|
+
audit_hits += a[1] + 0
|
|
129
|
+
audit_found += a[2] + 0
|
|
130
|
+
audit_rows++
|
|
131
|
+
} else {
|
|
132
|
+
audit_invalid++
|
|
133
|
+
}
|
|
134
|
+
} else {
|
|
135
|
+
audit_invalid++
|
|
136
|
+
}
|
|
137
|
+
} else if (NF >= 8) {
|
|
138
|
+
# A present empty audit field is malformed metadata, not an absent
|
|
139
|
+
# optional column. Keep the row for general metrics, but surface the
|
|
140
|
+
# invalid audit value instead of silently treating it as unrecorded.
|
|
141
|
+
audit_invalid++
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
}
|
|
145
|
+
END {
|
|
146
|
+
if (total_specs == 0) {
|
|
147
|
+
print "No findings data found in quality files."
|
|
148
|
+
exit 0
|
|
149
|
+
}
|
|
150
|
+
print "## Findings per Route"
|
|
151
|
+
print ""
|
|
152
|
+
printf "%-6s %5s %8s %s\n", "Route", "Specs", "Findings", "Avg"
|
|
153
|
+
printf "%-6s %5s %8s %s\n", "------", "-----", "--------", "---"
|
|
154
|
+
# Walk the declared route list, not the route map. A bare for-in over an
|
|
155
|
+
# associative array has unspecified order, so the tables came out in hash
|
|
156
|
+
# order (C, L, M, S on this awk) and the same report could order its rows
|
|
157
|
+
# differently on another awk. The reader compares routes by size, so the
|
|
158
|
+
# order has to be the one the route list declares.
|
|
159
|
+
for (ri = 1; ri <= route_n; ri++) {
|
|
160
|
+
r = rr[ri]
|
|
161
|
+
if (route_count[r] > 0) {
|
|
162
|
+
avg = route_total[r] / route_count[r]
|
|
163
|
+
printf "%-6s %5d %8d %.1f\n", r, route_count[r], route_total[r], avg
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
printf "%-6s %5d %8d %.1f\n", "TOTAL", total_specs, total_findings, total_findings/total_specs
|
|
167
|
+
|
|
168
|
+
print ""
|
|
169
|
+
print "## Routing Confusion Matrix"
|
|
170
|
+
print ""
|
|
171
|
+
printf "%-6s %5s %8s %s\n", "Route", "Specs", "High-Sev", "Zero-Findings"
|
|
172
|
+
printf "%-6s %5s %8s %s\n", "------", "-----", "--------", "------------"
|
|
173
|
+
for (ri = 1; ri <= route_n; ri++) {
|
|
174
|
+
r = rr[ri]
|
|
175
|
+
if (route_count[r] > 0) {
|
|
176
|
+
printf "%-6s %5d %8d %d\n", r, route_count[r], high_sev_by_route[r], zero_by_route[r]
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
print ""
|
|
181
|
+
print "## Triage Loops per Route"
|
|
182
|
+
print ""
|
|
183
|
+
print "How many verify-fix rounds each spec took. 1 is a first-pass clean."
|
|
184
|
+
print "Separates a spec that was hard from a spec that was planned badly."
|
|
185
|
+
print ""
|
|
186
|
+
printf "%-6s %5s %s\n", "Route", "Rows", "Avg loops"
|
|
187
|
+
printf "%-6s %5s %s\n", "------", "-----", "---------"
|
|
188
|
+
any_loops = 0
|
|
189
|
+
for (ri = 1; ri <= route_n; ri++) {
|
|
190
|
+
r = rr[ri]
|
|
191
|
+
if (loop_count[r] > 0) {
|
|
192
|
+
printf "%-6s %5d %.1f\n", r, loop_count[r], loop_total[r] / loop_count[r]
|
|
193
|
+
any_loops = 1
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
if (!any_loops) print "(no rows carry a triage-loop count yet)"
|
|
197
|
+
|
|
198
|
+
print ""
|
|
199
|
+
print "## Spec Audit Hit Rate"
|
|
200
|
+
print ""
|
|
201
|
+
print "Audit findings later confirmed by a verifier finding or a decisions.md"
|
|
202
|
+
print "entry naming the same gap. A rate near zero means the audit is being"
|
|
203
|
+
print "paid for and not used."
|
|
204
|
+
print ""
|
|
205
|
+
if (audit_found > 0) {
|
|
206
|
+
printf "%d of %d audit findings confirmed downstream (%.0f%%), across %d spec(s)\n", \
|
|
207
|
+
audit_hits, audit_found, 100 * audit_hits / audit_found, audit_rows
|
|
208
|
+
} else if (audit_rows > 0) {
|
|
209
|
+
printf "no audit findings to confirm across %d spec(s) (every audit was clean)\n", audit_rows
|
|
210
|
+
} else {
|
|
211
|
+
print "(no rows carry an audit hit rate yet)"
|
|
212
|
+
}
|
|
213
|
+
if (audit_unknown > 0) {
|
|
214
|
+
printf "%d spec(s) excluded: audit findings recorded, hits never were\n", audit_unknown
|
|
215
|
+
}
|
|
216
|
+
if (audit_invalid > 0) {
|
|
217
|
+
printf "Invalid audit-hits values: %d (expected -/0, ?/N, or hits/findings)\n", audit_invalid
|
|
218
|
+
}
|
|
219
|
+
if (invalid_finding_count > 0) {
|
|
220
|
+
print "Invalid finding-count values: " invalid_finding_count " (excluded from analysis)"
|
|
221
|
+
}
|
|
222
|
+
if (invalid_validate_count > 0) {
|
|
223
|
+
print "Invalid validate-pass values: " invalid_validate_count " (excluded from analysis)"
|
|
224
|
+
}
|
|
225
|
+
if (invalid_severity_count > 0) {
|
|
226
|
+
print "Invalid severity values: " invalid_severity_count " (excluded from analysis)"
|
|
227
|
+
}
|
|
228
|
+
if (invalid_dod_count > 0) {
|
|
229
|
+
print "Invalid dod-pass values: " invalid_dod_count " (excluded from analysis)"
|
|
230
|
+
}
|
|
231
|
+
if (invalid_understanding_count > 0) {
|
|
232
|
+
print "Invalid understanding values: " invalid_understanding_count " (excluded from analysis)"
|
|
233
|
+
}
|
|
234
|
+
if (invalid_triage_count > 0) {
|
|
235
|
+
print "Invalid triage-loop values: " invalid_triage_count " (excluded from triage averages)"
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
print ""
|
|
239
|
+
print "## Signals"
|
|
240
|
+
print ""
|
|
241
|
+
under_routed = 0
|
|
242
|
+
over_routed = 0
|
|
243
|
+
for (ri = 1; ri <= route_n; ri++) {
|
|
244
|
+
r = rr[ri]
|
|
245
|
+
if (route_count[r] > 0 && high_sev_by_route[r] > 0) {
|
|
246
|
+
printf "%d %s spec(s) with high-severity findings (potential under-routes)\n", high_sev_by_route[r], r
|
|
247
|
+
under_routed += high_sev_by_route[r]
|
|
248
|
+
}
|
|
249
|
+
if (route_count[r] > 0 && zero_by_route[r] > 0) {
|
|
250
|
+
printf "%d %s spec(s) with zero findings (potential over-routes)\n", zero_by_route[r], r
|
|
251
|
+
over_routed += zero_by_route[r]
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
if (under_routed == 0 && over_routed == 0) {
|
|
255
|
+
print "(no routing signals detected)"
|
|
256
|
+
}
|
|
257
|
+
print ""
|
|
258
|
+
print "(Manual review required: this report surfaces signals, not verdicts.)"
|
|
259
|
+
}' {} +
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Sizing calibration: compares the router's size call against what the plan
|
|
3
|
+
# capsule actually contained, across active and archived specs.
|
|
4
|
+
# Deterministic, zero model calls.
|
|
5
|
+
#
|
|
6
|
+
# The router states a size (S/M/L) before routing; implement logs it as the
|
|
7
|
+
# `started` event's detail. The capsule records reality as task groups. A
|
|
8
|
+
# repeated mismatch in one direction is a prompt-fix candidate for the build
|
|
9
|
+
# skill's sizing table, which is the whole point of this report: it turns
|
|
10
|
+
# "the router keeps getting X wrong" from an impression into a count.
|
|
11
|
+
#
|
|
12
|
+
# Advisory only: always exits 0. Specs whose `started` detail carries no
|
|
13
|
+
# standalone S/M/L token are skipped silently (resume details, older runs).
|
|
14
|
+
#
|
|
15
|
+
# Usage: sizing-calibration.sh [project-root]
|
|
16
|
+
set -u
|
|
17
|
+
PROJECT_ROOT="${1:-$(pwd)}"
|
|
18
|
+
SPECS="$PROJECT_ROOT/devos/specs"
|
|
19
|
+
|
|
20
|
+
[[ -d "$SPECS" ]] || { echo "No devos/specs yet - nothing to calibrate."; exit 0; }
|
|
21
|
+
|
|
22
|
+
ok=0 undersized=0 oversized=0
|
|
23
|
+
|
|
24
|
+
for ops in "$SPECS"/*/ops.jsonl "$SPECS"/archive/*/ops.jsonl; do
|
|
25
|
+
[[ -f "$ops" ]] || continue
|
|
26
|
+
dir="$(dirname "$ops")"
|
|
27
|
+
name="${dir##*/}"
|
|
28
|
+
capsule="$dir/spec.md"
|
|
29
|
+
[[ -f "$capsule" ]] || continue
|
|
30
|
+
detail=$(sed -n 's/.*"event":"started","detail":"\([^"]*\)".*/\1/p' "$ops" | head -1)
|
|
31
|
+
# The size call is a letter standing on its own. A capital inside a path
|
|
32
|
+
# or a file name (src/L.ts, L.md) reads the same way in the raw detail but
|
|
33
|
+
# is not a sizing decision, so the letter must not be glued to a path
|
|
34
|
+
# segment or a file extension. The first letter that stands alone is the
|
|
35
|
+
# call; a detail that only names files carries no size and is skipped.
|
|
36
|
+
size=$(printf '%s' "$detail" |
|
|
37
|
+
grep -oE '(^|[^A-Za-z0-9_./-])[SML]([^A-Za-z0-9_.]|$)' | head -1 |
|
|
38
|
+
grep -oE '[SML]')
|
|
39
|
+
[[ -n "$size" ]] || continue
|
|
40
|
+
groups=$(grep -cE '^###[[:space:]]+Task[[:space:]]+Group' "$capsule")
|
|
41
|
+
case "$size" in
|
|
42
|
+
M)
|
|
43
|
+
if [[ "$groups" -ge 5 ]]; then
|
|
44
|
+
echo "UNDERSIZED $name: sized M, capsule has $groups task groups (L candidate)"
|
|
45
|
+
undersized=$((undersized + 1))
|
|
46
|
+
else
|
|
47
|
+
ok=$((ok + 1))
|
|
48
|
+
fi
|
|
49
|
+
;;
|
|
50
|
+
L)
|
|
51
|
+
if [[ "$groups" -le 1 ]]; then
|
|
52
|
+
echo "OVERSIZED $name: sized L, capsule has $groups task group(s) (M candidate)"
|
|
53
|
+
oversized=$((oversized + 1))
|
|
54
|
+
else
|
|
55
|
+
ok=$((ok + 1))
|
|
56
|
+
fi
|
|
57
|
+
;;
|
|
58
|
+
*)
|
|
59
|
+
ok=$((ok + 1))
|
|
60
|
+
;;
|
|
61
|
+
esac
|
|
62
|
+
done
|
|
63
|
+
|
|
64
|
+
if ((ok + undersized + oversized == 0)); then
|
|
65
|
+
echo "No sizing data yet - specs with a size letter in their started event: none."
|
|
66
|
+
exit 0
|
|
67
|
+
fi
|
|
68
|
+
echo "---"
|
|
69
|
+
echo "calibrated: $ok ok, $undersized under-sized M, $oversized over-sized L"
|
|
70
|
+
echo "repeated mismatches in one direction are a build-skill sizing-table fix candidate"
|
|
71
|
+
exit 0
|