Class ::nsmcp::QuestionBackend
::nsmcp::QuestionBackend
create ...
Shared reporting rules for Codex and direct API backends.
Defined in /usr/local/ns/tcl/nsmcp/question-backend.tclClass Relations
- class: ::nx::Class
![[i]](/resources/acs-subsite/ZoomIn16.gif)
- superclass: ::nx::Object
![[i]](/resources/acs-subsite/ZoomIn16.gif)
- subclass: ::nsmcp::ChatCompletionsBackend
, ::nsmcp::CodexQuestionBackend![[i]](/resources/acs-subsite/ZoomIn16.gif)
::nx::Class create ::nsmcp::QuestionBackend \
-superclass ::nx::Object
Methods (to be applied on the object)
nsmcp::QuestionBackend
reportingInstructions base
- Parameters:
- base (required)
- Testcases:
-
No testcase defined.
return "$base Use one timezone consistently for window bounds, group occurrence times and commentary: honor the requested timezone, otherwise UTC. Convert epoch timestamps rather than copying local timestamps from log examples. For error summaries, report every returned group (count and description), severityTotals and ungroupedRecords; do not silently omit groups. Groups count log records, not unique incidents. Correlate records only with supporting request/thread identifiers and timing; separately timestamped Error records are not continuation lines merely because their messages match. Report coverage.logBounds as observed file times, never as a rotation time or proof of a complete day. Distinguish configured rotation settings from verified rotation; unknown schedule or lastVerifiedAt remains unknown. Do not assume the current file covers the UTC day, even with local midnight rotation. Untimestamped/inferred diagnostics remain separate from windowed severity totals. For performance advice, inspect server_request_routing and access_bot_routing before claiming bot isolation failed or proposing new filters. Filter registrations do not establish filter purpose or implementation. Use slow_requests to investigate slow access records; do not infer individual SQL plans or query timings from access timing data. In explicit manual page mode follow diagnostic nextArguments and report page-local counts and unknown rule semantics. access_bot_routing.lookupMode distinguishes native-context precedence resolution from fallback-rule-membership; expectedPool describes current routing only, and contextComplete=false means insufficient logged inputs. Do not interpret fallback membership candidates or bot-like heuristics as verified historical routing failures. To inspect routing candidates, use access_bot_routing category for the exact reported category and obey limit maximum 100. Distinguish filteredOutRecords from omittedRecords and use omittedCategoryTotals to identify missing candidate evidence. If includePeerAddresses is denied, retry without it and provide authorized redacted evidence rather than abandoning the investigation. A rescan is a new observation, not recovered retained evidence. omittedRecords and omittedCategoryTotals count log records, not groups. Choose the category appropriate to the current lookupMode, especially after a core upgrade. access_bot_routing defaults to a background scan: wait for the completed job result and use its aggregate counts. Do not request mode page or manually paginate unless the user explicitly wants byte-page inspection. Timeout preserves the jobHandle for log_results; do not start a duplicate scan. For server_history, use the default page size of 100 (maximum 100); do not choose small pages unless explicitly requested. Follow nextArguments unchanged until history.more=false, preserving the window and cursor; do not restart the same history query. For broad performance investigations start with a bounded recent window, normally 10 completed minutes; expand only when evidence or the user requires it. Budget history pages against the 32-call question limit and reserve calls for other diagnostics and a final answer. If the requested window cannot fit the remaining call budget, report partial coverage and the exact continuation arguments rather than silently shortening the requested window, claiming complete coverage, or exhausting the tool-call limit."
Methods (to be applied on instances)
<instance of nsmcp::QuestionBackend
> canonicalResult json
- Parameters:
- json (required)
- Testcases:
-
No testcase defined.
if {[catch {ns_json parse -output triples -- $json} root] || [lindex $root 1] ne "object"} {return $json}
if {[catch {ns_json triples gettype -path structuredContent -- $root}]} {return $json}
set structured [list {} [ns_json triples gettype -path structuredContent -- $root] [ns_json triples getvalue -output triples -path structuredContent -- $root]]
set duplicate [ns_json value -- $structured]
set fields {}
foreach {key type value} [lindex $root 2] {
if {$key eq "content" && $type eq "array"} {
set content {}
set index 0
foreach {i kind members} $value {
set omit false
if {$kind eq "object"} {
set item [ns_json parse [ns_json value -- [list {} object $members]]]
if {[dict exists $item type] && [dict get $item type] eq "text"
&& [dict exists $item text] && [dict get $item text] eq $duplicate} {set omit true}
}
if {!$omit} {lappend content $index $kind $members; incr index}
}
set value $content
}
lappend fields $key $type $value
}
return [ns_json value -- [list {} object $fields]]describe (scripted, public)
<instance of nsmcp::QuestionBackend
> describe
- Testcases:
-
No testcase defined.
return {backend unknown}run (scripted, public)
<instance of nsmcp::QuestionBackend
> run question state emit
- Parameters:
- question (required)
- state (required)
- emit (required)
- Testcases:
-
No testcase defined.
error "abstract QuestionBackend.run"