Conformance Check Failure
Check ID: USE-001
Severity: LOW
Category: Usability
Problem Description
Two handlers throw errors without using the standardized ERR_* prefixes defined in error_codes.cjs. Standardized error codes enable structured logging, monitoring dashboards, and alerting rules — and they are already the established pattern in other handlers (e.g., create_issue.cjs uses ERR_VALIDATION).
Affected Components
Current vs Expected Behavior
Current Behavior
// close_entity_helpers.cjs:404
throw commentError;
// generate_safe_outputs_tools.cjs:51, 60
throw new Error(msg);
Expected Behavior
Import the appropriate code from error_codes.cjs and prefix errors:
const { ERR_API, ERR_VALIDATION } = require("./error_codes.cjs");
// close_entity_helpers.cjs — wrap or annotate re-thrown API errors
throw new Error(`\$\{ERR_API}: \$\{commentError.message}`);
// generate_safe_outputs_tools.cjs — prefix validation/config errors
throw new Error(`\$\{ERR_VALIDATION}: \$\{msg}`);
Available codes: ERR_VALIDATION, ERR_PERMISSION, ERR_API, ERR_CONFIG, ERR_NOT_FOUND, ERR_PARSE, ERR_SYSTEM.
Remediation Steps
This task can be assigned to a Copilot coding agent with the following steps:
- In
close_entity_helpers.cjs: identify the catch block around line 404, determine the correct error category (likely ERR_API since it's a comment API call), and wrap the re-thrown error with a coded message.
- In
generate_safe_outputs_tools.cjs: add require("./error_codes.cjs") at the top and prefix the two throw new Error(msg) calls with the appropriate ERR_* code (likely ERR_VALIDATION or ERR_CONFIG).
- Ensure no test snapshots need updating after the change.
Verification
After remediation, verify the fix by running:
bash scripts/check-safe-outputs-conformance.sh
The check USE-001 should pass without errors.
References
- Safe Outputs Specification:
docs/src/content/docs/reference/safe-outputs-specification.md
- Error codes module:
actions/setup/js/error_codes.cjs
- Conformance Checker:
scripts/check-safe-outputs-conformance.sh
- Run ID: §24425263907
- Date: 2026-04-14
Generated by Daily Safe Outputs Conformance Checker · ● 115K · ◷
Conformance Check Failure
Check ID: USE-001
Severity: LOW
Category: Usability
Problem Description
Two handlers throw errors without using the standardized
ERR_*prefixes defined inerror_codes.cjs. Standardized error codes enable structured logging, monitoring dashboards, and alerting rules — and they are already the established pattern in other handlers (e.g.,create_issue.cjsusesERR_VALIDATION).Affected Components
actions/setup/js/close_entity_helpers.cjs— line 404:throw commentError;(re-throws without wrapping in a coded error)actions/setup/js/generate_safe_outputs_tools.cjs— lines 51, 60:throw new Error(msg)(noERR_*prefix)Current vs Expected Behavior
Current Behavior
Expected Behavior
Import the appropriate code from
error_codes.cjsand prefix errors:Available codes:
ERR_VALIDATION,ERR_PERMISSION,ERR_API,ERR_CONFIG,ERR_NOT_FOUND,ERR_PARSE,ERR_SYSTEM.Remediation Steps
This task can be assigned to a Copilot coding agent with the following steps:
close_entity_helpers.cjs: identify the catch block around line 404, determine the correct error category (likelyERR_APIsince it's a comment API call), and wrap the re-thrown error with a coded message.generate_safe_outputs_tools.cjs: addrequire("./error_codes.cjs")at the top and prefix the twothrow new Error(msg)calls with the appropriateERR_*code (likelyERR_VALIDATIONorERR_CONFIG).Verification
After remediation, verify the fix by running:
The check USE-001 should pass without errors.
References
docs/src/content/docs/reference/safe-outputs-specification.mdactions/setup/js/error_codes.cjsscripts/check-safe-outputs-conformance.sh