Skip to content

docs(skills): apply the #2505 retrospective process improvements - #2534

Merged
josecelano merged 7 commits into
torrust:developfrom
josecelano:2505-retrospective-improvements
Oct 14, 2026
Merged

josecelano merged 7 commits into
torrust:developfrom
josecelano:2505-retrospective-improvements

Conversation

@josecelano

Copy link
Copy Markdown
Member

Applies the seven process improvements proposed in the issue #2505 implementation retrospective (docs/issues/closed/2505-udp-banned-ips-metric/implementation-retrospective.md, "Improvements for Future Work"). The maintainer reviewed each proposal and accepted its wording. Related to #2505 (closed).

Changes

One signed commit per proposal:

# Commit File Lesson from #2505
1 docs(benchmarking): plan the expected cost of deliberately added work docs/benchmarking.md The one-sided pass rule could not pass for a path the fix deliberately made do more work; the cost was accepted only after measuring.
2 docs(benchmarking): check for running trackers and busy ports before measuring docs/benchmarking.md, run-benchmarks skill A recheck tracker held the default health check port 127.0.0.1:1313; the benchmark tracker exited and a run measured 0 responses/s.
3 docs(skills): confirm a mutation compiled before reading its test result write-unit-test skill A mutation that did not compile looked like "no test failed".
4 docs(benchmarking): process numeric evidence with LC_ALL=C docs/benchmarking.md Under a decimal-comma locale, awk printed 9,000 for 9.0.
5 docs(skills): run the final bug recheck after the last production change fix-bug skill The "final" recheck and after measurement predated review fixes and had to be repeated.
6 docs(templates): run dependent manual verification steps one at a time docs/templates/MANUAL-VERIFICATION-EVIDENCE.md Two dependent probes ran as parallel tool calls; the run was discarded.
7 docs(skills): run each signed commit as its own step commit-changes skill A commit chained after a GPG timeout swept the failed commit's staged rename into itself.

The retrospective's "Avoiding Overcorrection" notes are respected: the one-sided pass rule is kept, benchmark runs are not required to avoid all concurrent activity, and the reset interval is unchanged. The archived retrospective stays as recorded.

Validation

  • Pre-commit hook passed for each commit (linter all); pre-push checks passed.
  • Commands in the new text were run on the development machine: ss -lun 'sport = :3000' / ss -ltn 'sport = :1313' print only the header when the ports are free, and awk 'BEGIN{printf "%.3f", 9.0}' prints 9,000 under es_ES.UTF-8 and 9.000 under LC_ALL=C.

josecelano and others added 7 commits October 14, 2026 17:15
A one-sided pass rule cannot pass for a benchmark whose path the change
deliberately makes do more work. Ask the plan to state the expected cost or
a tolerance, agreed with the maintainer before the after measurement.
Proposal 1 of the issue torrust#2505 implementation retrospective.

Co-authored-by: Copilot <[email protected]>
…measuring

The benchmarking configuration does not set the health check API, which
starts on 127.0.0.1:1313, so a tracker left running elsewhere makes the
benchmark tracker exit at startup. Check the ports before measuring.
Proposal 2 of the issue torrust#2505 implementation retrospective.

Co-authored-by: Copilot <[email protected]>
A mutation the compiler rejects runs no test, so filtered output looks like
no test failed. Ask to confirm the mutation compiled in the
mutate-then-restore step. Proposal 3 of the issue torrust#2505 implementation
retrospective.

Co-authored-by: Copilot <[email protected]>
Under a locale with a decimal comma, awk and printf print 9,000 for 9.0 or
truncate decimals, which can make benchmark medians look quantized.
Proposal 4 of the issue torrust#2505 implementation retrospective.

Co-authored-by: Copilot <[email protected]>
Require the final recheck and any planned after measurement to run after
the last production change, including review fixes, and to be repeated if
production code changes later. Proposal 5 of the issue torrust#2505
implementation retrospective.

Co-authored-by: Copilot <[email protected]>
Steps that depend on the state an earlier step leaves must not run as a
batch of parallel commands or agent tool calls. Proposal 6 of the issue
torrust#2505 implementation retrospective.

Co-authored-by: Copilot <[email protected]>
A commit chained after a failed signature in the same command sweeps the
failed commit's staged changes into itself. Require each signed commit to
be checked before anything else is staged or committed. Proposal 7 of the
issue torrust#2505 implementation retrospective.

Co-authored-by: Copilot <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 14, 2026 16:34
@josecelano
josecelano requested a review from a team as a code owner October 14, 2026 16:34
@josecelano josecelano self-assigned this Oct 14, 2026
@josecelano
josecelano requested a review from da2ce7 October 14, 2026 16:37
@josecelano

Copy link
Copy Markdown
Member Author

ACK 0782a82

@josecelano
josecelano merged commit 48c4d30 into torrust:develop Oct 14, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The manual-verification rule mishandles long-running services, and the linked benchmark workflow remains inconsistent with the new tolerance guidance.

2 open findings
What changed in this PR

Applies process lessons from issue #2505 to benchmarking, testing, verification, and commit workflows.

Changes:

  • Strengthens benchmark planning and environment checks.
  • Adds mutation and final-recheck safeguards.
  • Prevents unsafe parallel verification and commit sequencing.
File Description
docs/​benchmarking.md Adds benchmark cost, locale, and port guidance.
.github/​skills/​dev/​benchmarking/​run-benchmarks/​SKILL.md Adds benchmark port checks.
.github/​skills/​dev/​testing/​write-unit-test/​SKILL.md Requires confirming mutations compile.
.github/​skills/​dev/​debugging/​fix-bug/​SKILL.md Moves final verification after production changes.
.github/​skills/​dev/​git-workflow/​commit-changes/​SKILL.md Requires isolated signed commit steps.
docs/​templates/​MANUAL-VERIFICATION-EVIDENCE.md Adds dependent-step sequencing guidance.

🧠 Review effort: Balanced


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread docs/benchmarking.md
Comment on lines +76 to +79
improvement. When the change deliberately adds work to a measured path, for example maintaining
a counter on every event, the one-sided rule cannot pass for that benchmark as written: state
the expected cost or an explicit tolerance for it in the plan, agreed with the maintainer before
the after measurement. In issue #2505 the plan had neither, so the after measurement failed the
Comment on lines +46 to +48
Run steps that depend on the state an earlier step leaves one at a time,
waiting for each to finish; never issue them as one batch of parallel commands
or agent tool calls. If dependent steps ran concurrently, discard the run and
@josecelano
josecelano deleted the 2505-retrospective-improvements branch October 14, 2026 16:54

@da2ce7 da2ce7 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed at 0782a8210213820d02f221e497baa53c345a5335 (post-merge). Recomputed from the bytes at the merged head, against the merge base 3b0b40047; the PR merged at 16:50:43Z as 48c4d3013.

Label: POST_MERGE_FINDINGS — the loop's review was requested at 16:37:28Z, and the PR merged at 16:50:43Z, before this round ran. The findings below stand at the merged head and are for a follow-up; no ACK follows a merged PR.

Traceability. Seven commits, 6 files, +44/−5, one per proposal of the archived #2505 retrospective ("Improvements for Future Work", items 1-7, implementation-retrospective.md:95-111), in order: 1 9863ce61a, 2 65f4d484d, 3 45561574c, 4 84c339ce1, 5 bd604563b, 6 20172815a, 7 0782a8210. Each rule says what its proposal says and cites the #2505 incident. No proposal is left unapplied; the "Manual-only timing cost" lesson had none. The "Avoiding Overcorrection" notes hold: the one-sided rule stays, and the reset interval is unchanged.

The rules as written.

  • The port check names the right ports. The benchmarking configuration binds only UDP 0.0.0.0:3000 and leaves the health check API on its default 127.0.0.1:1313, and the two ss filters are valid.
  • fix-bug defers to write-unit-test for mutate-then-restore (fix-bug/SKILL.md:43-44), so one compile-check rule covers both.
  • LC_ALL=C sits with the numeric medians in benchmarking step 4. It is narrower than the proposal ("evidence-processing commands"), but every numeric command in #2505 was benchmark evidence.
  • No issue tag is right for a related, closed issue (AGENTS.md:394).
  • Skill versions were not bumped. Most earlier edits to these four skills did not bump them either, so there is no convention to apply.
  • The bot's F1 (a long-running tracker step never "finishes", so readiness should gate later steps) and F2 (run-benchmarks step 3 still states the strict rule without the new exception) both hold at the merged head; they are not repeated inline. F15-F19 below are new.

Hygiene. Seven Conventional subjects (benchmarking, skills, templates); bodies match their diffs; author equals committer; times ascend 16:15:54Z-16:31:06Z; one trailer line each; no banned token; git diff --check clean. The PR body's table matches the commits. The author's ACK comment (16:39:23Z) preceded both reviews.

Findings

  • F15 [Nit] docs/benchmarking.md:77: "cannot pass" is contradicted by #2505's own IPv4 results.
  • F16 [Suggestion] fix-bug/SKILL.md:56: the after-measurement half applies only to bug fixes.
  • F17 [Suggestion] fix-bug/SKILL.md:58: no route for changes that cannot affect the recheck.
  • F18 [Nit] commit-changes/SKILL.md:88: the passing %G? letters and the && case are unstated.
  • F19 [Nit] docs/benchmarking.md:98: "no other tracker is running" would have flagged #2505's own final Criterion run.

Checked, no finding: each rule against its proposal; the configuration's ports; the ss syntax; neighbouring skills and agents for conflicting commit or mutation guidance; the version-bump history; the merge relation (48c4d3013 has first parent e2e21f20c and second parent the head).

Checks

On the loop's compute hub at the merged head, merge base 3b0b40047 (the first parent of the merge commit 48c4d3013 is e2e21f20c; the gate's base is the head's own merge base 3b0b40047; receipt server-gates-krkavec-298): pre-commit profile gate exit 0 (81 s); linter markdown, linter cspell, linter lychee exit 0; frontmatter-validator --all: 19 errors / 4 warnings at this head and 19 / 4 at 3b0b40047 re-measured, none in the files this PR edits. GitHub checks at this head at posting time: "Docs Lint: completed/success". At posting, develop is 48c4d3013.

Comment thread docs/benchmarking.md
Criterion median is not above the highest baseline median". A two-sided band fails on an
improvement.
improvement. When the change deliberately adds work to a measured path, for example maintaining
a counter on every event, the one-sided rule cannot pass for that benchmark as written: state

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Nit][F15] "Cannot pass" overstates it: #2505's own final run passed the rule on every IPv4 record_error case.

The archived final after run (docs/issues/closed/2505-udp-banned-ips-metric/performance-evidence.md:543-545) has IPv4 record_error at 10.66-10.69 ns against limits of 10.69-10.87 ns. All three pass despite the added work. With a baseline spread up to 5.1%, a small added cost may or may not exceed the highest baseline median. The instruction itself, to state the expected cost or a tolerance, is right.

Follow-up: say the rule "is expected to fail, and a pass would be noise", rather than "cannot pass".

A passing automated test is not a substitute for the final real-artifact recheck. The recheck proves
that the artifact-level symptom observed at the start is gone.

Run the final recheck, and the after measurement when the issue plans one, after the last

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Suggestion][F16] The after-measurement half of this rule binds only bug fixes; other performance work never reads it.

docs/benchmarking.md step 3 ("Repeat the measurement after the change", :83) and run-benchmarks step 5 govern every change that plans before-and-after evidence: a perf or refactor PR, not only a bug. Neither says that the after measurement must follow the last production change, review fixes included, or that it is repeated when production code changes afterwards.

Follow-up: state the after-measurement part in docs/benchmarking.md step 3, the source of truth, and have this skill point to it.


Run the final recheck, and the after measurement when the issue plans one, after the last
production change, including changes made to answer review findings. If production code changes
after them, repeat both, and name in the evidence the commit whose build they ran on. In issue #2505

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Suggestion][F17] The rule has no route for a later change that cannot affect the recheck or the measured path.

As written, a production change that only edits a log message after the final recheck means repeating the whole like-for-like recheck, including #2505's one-hour reset wait, and the after measurement. The #2505 task review offered a lighter route for exactly this case: "either rerun it (one reset interval) or record a maintainer-accepted rationale that the reset path is byte-identical" (docs/issues/closed/2505-udp-banned-ips-metric/agent-review-reports.md:122-124).

Follow-up, optional: allow a recorded, maintainer-accepted rationale in place of a rerun. It would name the commit and say why it cannot change the recheck's outcome or the measured code.

### One Signed Commit per Step

Run each signed commit as its own step, and check its result (the exit status, and
`git log -1 --format=%G?`) before staging or committing anything else. Never chain a commit with

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Nit][F18] Two terms of the new commit-step rule are left for the reader to guess.

  • It asks the agent to check git log -1 --format=%G? but does not say which letters pass. The archived The UDP banned-IPs metric counts clients that are not banned #2505 agent review report records %G? = U for this repository's commits (docs/issues/closed/2505-udp-banned-ips-metric/agent-review-reports.md:50), so an agent that accepts only G would stop after every commit.
  • "As its own step" sits beside this skill's own recipe that chains the hook script and the commit with && (:161-162). Only the commit's followers, joined by ; or newlines, are named as forbidden.

Follow-up: list the accepted letters, and say that a commit may follow its own gate with && but nothing may follow a commit in the same command.

Comment thread docs/benchmarking.md
5. **Check the machine first.** On a shared desktop, run `uptime` and look for other builds; wait
until the load is close to the baseline's before measuring.
until the load is close to the baseline's before measuring. Also check that no other tracker is
running and that the ports the benchmarking configuration uses are free: UDP `3000`, and TCP

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Nit][F19] "No other tracker is running" is broader than the incident, and it would have flagged #2505's own final Criterion run.

The #2505 collision was a port: a second tracker held 127.0.0.1:1313, so the load-test tracker exited. Criterion microbenchmarks bind no port. The accepted final Criterion run in #2505 ran "while the final manual recheck's tracker was idle waiting for its reset" (docs/issues/closed/2505-udp-banned-ips-metric/performance-evidence.md:516). The retrospective's own "Avoiding Overcorrection" note rejects requiring benchmark runs to avoid all concurrent activity.

Follow-up: scope the check to the load test (no other tracker on the benchmarking ports), and let Criterion runs proceed beside an idle tracker, recording it as #2505 did.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants