2026-09-26 16:14:16 +00:00
|
|
|
|
# Promptkit Upgrade Review Remediation
|
|
|
|
|
|
|
|
|
|
|
|
## Scope And Status
|
|
|
|
|
|
|
|
|
|
|
|
Review baseline: `e177d7c`, covering implementation commits after `5c3b0cf`.
|
2026-09-26 16:17:23 +00:00
|
|
|
|
This document records a resolved test-contract issue; it does not authorize
|
2026-09-26 16:14:16 +00:00
|
|
|
|
unrelated implementation changes. No runtime defect or missing planned feature
|
|
|
|
|
|
was identified in this review. Release preparation remains separate work.
|
|
|
|
|
|
|
|
|
|
|
|
## R1: Remove The Unrequested Context-Identity Invariant
|
|
|
|
|
|
|
2026-09-26 16:17:23 +00:00
|
|
|
|
Priority: P3 (low). Status: Complete.
|
2026-09-26 16:14:16 +00:00
|
|
|
|
|
2026-09-26 16:17:23 +00:00
|
|
|
|
Original location: `internal/adapter/http/handler_test.go:334–349`,
|
2026-09-26 16:14:16 +00:00
|
|
|
|
`TestHandlerRunTimeoutValidationAndContextMapping`, introduced in `7de2b02`.
|
|
|
|
|
|
|
2026-09-26 16:17:23 +00:00
|
|
|
|
The test's `child` field and `(ctx != parent) != tc.child` assertion required
|
2026-09-26 16:14:16 +00:00
|
|
|
|
the exact parent context object for omitted/null/zero timeouts and a distinct
|
|
|
|
|
|
object for a positive timeout. The requested contract concerns effective
|
|
|
|
|
|
deadlines and cancellation propagation, not Go interface identity. In
|
|
|
|
|
|
particular, a harmless derived context that preserves the parent's deadline,
|
|
|
|
|
|
values, and cancellation would fail the omission cases despite satisfying the
|
|
|
|
|
|
application contract.
|
|
|
|
|
|
|
2026-09-26 16:17:23 +00:00
|
|
|
|
This elevated an incidental implementation choice into a test-enforced
|
2026-09-26 16:14:16 +00:00
|
|
|
|
invariant, contrary to the [agent policy](../policy/agents.md) and
|
|
|
|
|
|
[testing policy](../policy/testing.md). The current handler's context behavior
|
|
|
|
|
|
is correct; this is a maintainability issue, not a runtime cancellation bug.
|
|
|
|
|
|
|
|
|
|
|
|
### Required Change
|
|
|
|
|
|
|
|
|
|
|
|
Remove the identity comparison and the identity-only table field. Retain
|
|
|
|
|
|
behavioral assertions that an earlier parent deadline is not extended and
|
|
|
|
|
|
parent cancellation reaches execution. For omitted/null/zero values, verify
|
|
|
|
|
|
that no deadline is introduced when the parent has none. Retain coverage of
|
|
|
|
|
|
positive deadlines and the distinction between a canceled execution context
|
|
|
|
|
|
and a provider-attempt timeout while the execution context remains live.
|
|
|
|
|
|
|
|
|
|
|
|
Use the existing runner seam and focused cases; do not introduce a context
|
|
|
|
|
|
wrapper framework, timer abstraction, new public guarantee, or production
|
|
|
|
|
|
refactor solely to change this test.
|
|
|
|
|
|
|
|
|
|
|
|
### Completion Criteria
|
|
|
|
|
|
|
|
|
|
|
|
- Tests protect effective deadline/cancellation behavior without requiring
|
|
|
|
|
|
context object identity.
|
|
|
|
|
|
- A semantically equivalent derived context does not fail merely because it
|
|
|
|
|
|
is a different object.
|
|
|
|
|
|
- Existing timeout validation and HTTP outcome coverage remains intact.
|
|
|
|
|
|
|
2026-09-26 16:17:23 +00:00
|
|
|
|
### Resolution And Validation
|
|
|
|
|
|
|
|
|
|
|
|
Removed the identity-only table field and context comparisons. The test now
|
|
|
|
|
|
checks effective deadlines, including omitted/null/zero requests with no
|
|
|
|
|
|
parent deadline, and explicitly checks that parent cancellation reaches the
|
|
|
|
|
|
runner. Existing positive-deadline integration tests and live-context
|
|
|
|
|
|
provider-timeout mapping remain intact. No production code changed.
|
|
|
|
|
|
|
|
|
|
|
|
Focused HTTP timeout tests, `go test ./...`, `go test -race ./...`,
|
|
|
|
|
|
`go vet ./...`, a native build outside the repository, and `git diff --check`
|
|
|
|
|
|
all passed after remediation.
|
|
|
|
|
|
|
|
|
|
|
|
## Original Review Verification
|
2026-09-26 16:14:16 +00:00
|
|
|
|
|
|
|
|
|
|
- `go test -race -count=1 ./...` passed, including retry, shared-capacity,
|
|
|
|
|
|
deadline, report, definition-conformance, and architecture-boundary tests.
|
|
|
|
|
|
- `go vet ./...` passed.
|
|
|
|
|
|
- A native `cmd/scriptorium` build passed, with output outside the repository.
|
|
|
|
|
|
- The selected dependency is Promptkit v0.11.0 with its intended v2 catalogs.
|
|
|
|
|
|
- Application code, tests, release automation, and historical releases were
|
|
|
|
|
|
not changed during this review.
|
|
|
|
|
|
|
|
|
|
|
|
The runtime ownership boundaries remain as intended: Promptkit owns framework
|
|
|
|
|
|
formats, execution, retries, and backend admission; Scriptorium owns executable
|
|
|
|
|
|
adapters, application settings, HTTP artifact policy, deadlines, and terminal
|
|
|
|
|
|
report presentation. No additional runtime restrictions, durable workflow
|
|
|
|
|
|
state, or extra release compliance gates were identified in the reviewed diff.
|