mirror of
https://github.com/skilfoy/ARTEX-English.git
synced 2026-12-03 13:11:02 +00:00
The application tree is BaaRai/ARTEX v0.7.0 (22ae88af), imported as one commit because that history is not in this repository. This commit adds the cloud installer, a defender pack for the console and the known-bad image names, and a supply-chain check. The opt-in update banner points at this fork and stays off in the cloud compose file.
31 lines
804 B
Go
31 lines
804 B
Go
package server
|
|
|
|
import (
|
|
"database/sql"
|
|
"errors"
|
|
"log"
|
|
"net/http"
|
|
"strconv"
|
|
)
|
|
|
|
// taskOutcome returns one task's production and cost baseline. It is the
|
|
// measurement layer for later RSI comparisons (harness2, Google Research,
|
|
// arXiv 2610.14224): nothing here changes agent behavior.
|
|
func (s *Server) taskOutcome(w http.ResponseWriter, r *http.Request) {
|
|
id, err := strconv.ParseInt(r.PathValue("id"), 10, 64)
|
|
if err != nil || id <= 0 {
|
|
writeErr(w, 400, "invalid task id")
|
|
return
|
|
}
|
|
outcome, err := s.m.PG().TaskOutcome(r.Context(), id)
|
|
if errors.Is(err, sql.ErrNoRows) {
|
|
writeErr(w, 404, "task not found")
|
|
return
|
|
}
|
|
if err != nil {
|
|
log.Printf("[tasks] outcome query failed for %d: %v", id, err)
|
|
writeErr(w, 500, "outcome query failed")
|
|
return
|
|
}
|
|
writeJSON(w, 200, outcome)
|
|
}
|