::nx::Object ::nx::Object __default_accessor __default_method_call_protection __object_configureparameter __resolve_method_path contains copy delete object method delete object property delete object variable destroy_on_cleanup info consts info info info lookup parameters info lookup slots info lookup syntax info lookup variables info object method args info object method body info object method callprotection info object method debug info object method definition info object method definitionhandle info object method deprecated info object method exists info object method handle info object method origin info object method parameters info object method registrationhandle info object method returns info object method submethods info object method syntax info object method type info object slots info object variables info variable definition info variable name info variable parameter move object alias object forward object method object property object variable private protected public qn require namespace require object method require private object method require protected object method require public object method serialize ::nsmcp::QuestionBackend ::nsmcp::QuestionBackend → reportingInstructions canonicalResult describe run ::nsmcp::QuestionBackend->::nx::Object ::nsmcp::ChatCompletionsBackend ::nsmcp::ChatCompletionsBackend describe init run streamClose streamData streamDrain streamHeaders streamOpen ::nsmcp::ChatCompletionsBackend->::nsmcp::QuestionBackend ::nsmcp::CodexQuestionBackend ::nsmcp::CodexQuestionBackend describe run ::nsmcp::CodexQuestionBackend->::nsmcp::QuestionBackend

Class ::nsmcp::QuestionBackend

::nsmcp::QuestionBackend[i] create ...

Shared reporting rules for Codex and direct API backends.
Defined in /usr/local/ns/tcl/nsmcp/question-backend.tcl

Class Relations

  • class: ::nx::Class[i]
  • superclass: ::nx::Object[i]
  • subclass: ::nsmcp::ChatCompletionsBackend[i], ::nsmcp::CodexQuestionBackend[i]
::nx::Class create ::nsmcp::QuestionBackend \
     -superclass ::nx::Object

Methods (to be applied on the object)

  • reportingInstructions (scripted, public)

     nsmcp::QuestionBackend[i] 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)

  • canonicalResult (scripted, public)

     <instance of nsmcp::QuestionBackend[i]> 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[i]> describe

    Testcases:
    No testcase defined.
    return {backend unknown}
  • run (scripted, public)

     <instance of nsmcp::QuestionBackend[i]> run question state emit
    Parameters:
    question (required)
    state (required)
    emit (required)

    Testcases:
    No testcase defined.
    error "abstract QuestionBackend.run"