Repository navigation
[spec-enforcer] Enforce specifications for workflow/taint, workflowcontract, workqueue - #79247
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain, and the supplied evidence indicates the change is limited to black-box specification tests covering the documented taint package API.
No open issues 🎉
What changed in this PR
Adds black-box, README-derived specification tests for the workflow/taint package, covering its public AST traversal, interpolation, symbolic source analysis, bindings, and parser interface contracts.
Changes:
- Verifies all projected
JavaScriptNodechild fields, includingOther. - Tests interpolation visitation and symbolic source analysis with configured rules and bindings.
- Adds compile-time conformance checks for parser interfaces and
ExpressionError.
| File | Description |
|---|---|
| pkg/workflow/taint/spec_test.go | Adds external-package specification tests for the taint package’s documented public API. |
Review effort: Lite (adaptive)
|
Warning Threat detection engine error Threat detection could not complete its analysis due to a tooling error. This is not a security finding. What happenedThe threat detection engine failed to produce results. Review the workflow run logs to troubleshoot the error. 🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:
Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering. Structured data{
"completed_task": 0,
"head": "72af337d9716f954b28bb6eeb13212e850696862",
"kind": "requested",
"schema_version": "1",
"state": "4dc491b758a6b463ec5d7f3a324a42ade2e8277e7985315dce7a0c63fe11d85d",
"work": [
"0215fa6a7e95d212b943e1dcdbb6a5dd7a082cda1dd71a971263c5c8122eb0a6",
"e9d7501fc834b70ac771af5e7694ba7f29ea683b65e0f01f096571f99da4b76f"
],
"workflow": "pr-sous-chef"
}
|
…4514452820-94e5cfc310e785ef Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Merged latest |
Warning
Threat detection engine error
Threat detection could not complete its analysis due to a tooling error. This is not a security finding.
What happened
The threat detection engine failed to produce results.
Review the workflow run logs to troubleshoot the error.
Specification Test Enforcement
Adds README-derived external-package tests for
workflow/taintand reviews the next two packages in rotation. The new suite checks every exported AST child field, includingOther, interpolation visits, and supplied symbolic source rules and bindings. Parser interface conformance is checked at compile time.workflow/taintworkflowcontractworkqueueCounts represent top-level test functions. The new taint functions contain 42 passing subtests. Existing workqueue tests already cover its concrete README contracts. Adding workflowcontract tests would duplicate existing test logic or invent a runtime API.
Test Derivation
All expectations come from package README.md specifications. Implementation-source inspection was limited to declarations, signatures, import paths, and type existence. Tests use exported APIs and synthetic symbolic inputs. The file starts with
(go/redacted):build !integration, usesTestSpec_names, and includes descriptive assertions.Spec-Implementation Mismatches
None observed in the behaviors tested.
SPEC_AMBIGUITYcomments identify unspecified child ordering, duplicate/nil handling, callback offsets, visit order, and representation of expressions without sources. Further workqueue scheduling and ledger tests need valid fixtures and acceptance details absent from its README.Validation
All 17 selected-package specification test functions pass. Changed-code golangci-lint reports 0 issues. Experimental coverage was accepted under
spec-enforcer/generated-tests; rotation state, enforcement records, and merged README hashes were saved and read back successfully.Full repository validation remains blocked, so this PR is a draft: workflow compilation rejects the existing
tools.work-queue.observerproperty in.github/workflows/smoke-work-queue-monitor.md:21. Custom lint also reports an existing CRLF-handling diagnostic atpkg/workflow/taint/workflow.go:425; it reports no diagnostics in the added file.Validation details
make fmtcompleted.go build ./pkg/workflow/taint/... ./pkg/workqueue/...passed.go test -v -run TestSpec ./pkg/workflow/taint/ ./pkg/workqueue/ ./pkg/workflowcontract/passed. The test-only workflowcontract package compiled and had no matching specification tests.make agent-report-progressran its build, schema, and impactedtest-unitchecks successfully. The initially missing repository-pinned golangci-lint was installed in temporary storage and changed-code lint then passed.test-unitwas run once.make check-workflow-driftcompiled 366 workflows successfully and failed on the existing observer property. Generated incidental changes were restored.Round-Robin State
workflow/taint,workflowcontract,workqueueactionpins,agentdrain,atif, subject to specification-change and missing-test prioritiesResolve the existing validation failures and rerun the repository gate before marking this draft ready.
References: §44514452820