SuperTrace¶
SuperTrace is the run history for Software Factory. It records how each WorkOrder ran, shows it in Factory Studio and the CLI, and can export a metadata-only trace to an OpenTelemetry-compatible destination when you ask.
What SuperTrace records¶
For every Factory run, SuperTrace keeps a project-local record in the existing WorkOrder store under .superqode/:
- Stage attempts with start and end times, retries and outcomes.
- Harness runs, model requests and tool calls, each with timing and status.
- Token counts and cost, when the harness reports them.
- References to verification, delivery and monitor receipts.
Harness activity passes through an allowlist before it is stored. Only short labels (provider, harness, model and tool names), numbers and statuses are kept. Prompts, tool arguments, tool output and file contents are never stored in the trace record. Factory Studio also shows the task text and stage errors stored in the WorkOrder itself, which stay local.
The same history appears in Factory Studio under Observe โ SuperTrace. The Attention Inbox opens a run at the exact stage or receipt that needs attention. From a failed attempt you can draft a regression or benchmark case for review.
What leaves the machine¶
Nothing leaves the machine unless you export. An exported trace is OTLP metadata only:
| Attribute group | Examples |
|---|---|
| Span structure | trace and span IDs, parent links, start and end times, status |
| Operations | fixed names for workflow, harness, model and tool activity |
| Usage | input and output token counts, cost |
| Identity | the WorkOrder ID as the conversation and session ID, a hashed stage key, the attempt number |
| Failures | an error.type value such as stage_failed or task.failed |
| Resource | service.name, service.version and the SuperTrace scope |
Provider, model, runtime, harness and tool labels stay in the local trace. Prompts, tool arguments, tool output, source code, error text, WorkOrder task text and protected check definitions stay on the machine.
Export is opt-in¶
Export is a deliberate, three-step action:
- Preview shows the destination, endpoint, span count and payload size, and returns a digest for that exact payload.
- Queue stores the previewed payload in a project-local outbox. It only accepts the digest from the preview.
- Send makes the network request, using a credential you supply for that send.
Endpoints must use HTTPS, or HTTP on a loopback address for a local receiver. Credentials are never written to the outbox, the trace record or the exported payload. Redirects are not followed.
Use Save JSON in the app, or sq factory traces export, to get the same metadata-only payload as a local file without any network request. Run :factory traces --help in the terminal UI to see the available commands.
Span conventions¶
Spans follow the OpenTelemetry GenAI semantic conventions, which are still under development upstream, and add OpenInference attributes for destinations that read them.
| Span | Name | Key attributes |
|---|---|---|
| Run | invoke_workflow superqode-factory | gen_ai.operation.name, gen_ai.conversation.id, session.id |
| Stage attempt | factory.stage_attempt | superqode.attempt, superqode.stage.key |
| Harness | invoke_agent superqode | gen_ai.agent.name |
| Model | chat | gen_ai.usage.input_tokens, gen_ai.usage.output_tokens, llm.token_count.*, llm.cost.total |
| Tool | execute_tool | gen_ai.operation.name |
| Verification | factory.verification | linked to the run span |
Every span carries openinference.span.kind. Failed spans carry error.type and an error status. Model and harness spans are CLIENT spans. All other spans are INTERNAL. The workflow span reports successful execution after all stages succeed or are skipped. It reports an error for a failed or cancelled WorkOrder, including a cancellation between stages. Verification has its own span and outcome.
Destinations¶
| Destination | Default endpoint | Credential | Extra setting |
|---|---|---|---|
| OpenTelemetry Collector | http://127.0.0.1:4318/v1/traces | Optional bearer token | None |
| LangSmith | https://api.smith.langchain.com/otel/v1/traces | API key | Project name |
| Langfuse | https://cloud.langfuse.com/api/public/otel/v1/traces | Public key and secret key | None |
| Arize Phoenix | http://127.0.0.1:6006/v1/traces | Optional bearer token | Project name |
| Logfire | https://logfire-us.pydantic.dev/v1/traces | Write token | None |
| MLflow | http://127.0.0.1:5000/v1/traces | Optional bearer token | Experiment ID (required) |
The default endpoints are examples for the primary cloud region or a local receiver. For another region or a self-hosted server, enter the full /v1/traces URL of that deployment.
OpenTelemetry Collector and MLflow receive OTLP JSON. The other destinations receive OTLP protobuf. The macOS app bundles the protobuf runtime. For the CLI, install the observability extra to send protobuf.
Use the CLI¶
sq factory traces list
sq factory traces show WORK_ID
sq factory traces export WORK_ID > trace.json
sq factory traces preview WORK_ID --destination langfuse
sq factory traces enqueue WORK_ID --destination langfuse --digest DIGEST
sq factory traces send DELIVERY_ID \
--credential-env LANGFUSE_SECRET_KEY --public-key-env LANGFUSE_PUBLIC_KEY
--credential-env and --public-key-env take the name of an environment variable, so the secret never appears in the command line or shell history. Any variable name works. The names above are conventions, not requirements. Set the variable in the shell that runs sq:
export LANGFUSE_PUBLIC_KEY="YOUR_PUBLIC_KEY"
export LANGFUSE_SECRET_KEY="YOUR_SECRET_KEY"
For LangSmith pass the API key variable, for Logfire pass the write token variable, and for the other destinations pass a bearer token variable only if your receiver requires one. Set the project name, or the MLflow experiment ID, with --routing on preview and enqueue. See the Factory commands reference for every option.
Use the macOS app¶
In Factory Studio, open Observe โ SuperTrace or search for Open SuperTrace in โK. The destination tiles open setup details and the project delivery queue. To send a trace, select a run and choose Export trace. Pick a destination, check the endpoint, choose Preview export, then Queue export. Enter the credential and choose Send from the queue. The app keeps the credential in memory for that send only.
Coding sessions and harness checks¶
Choose View trace in a coding thread or beside a result in Harness Studio โ Check evidence. You can also choose Coding sessions or Harness checks in SuperTrace. Choose Enable session traces for this project to view its existing local records. This choice is saved on the Mac and applies to sessions using local models, API keys, subscriptions or ACP. The timeline uses activity retained by the app, including tool activity and approvals from connected ACP agents. Native runtimes can also report individual model calls. Token usage, cost and activity duration appear when the runtime records them. Use Open coding turn for the original conversation and output.
Finished sessions can be saved as OTLP JSON or sent through the project delivery queue. Exports contain metadata from recorded activity. Prompts, tool arguments, output and private runtime labels stay local.
Turn off session traces closes this view and pauses queued session exports for the project. Your Agent Activity history remains available in the original threads. You can discard queued exports from the project outbox.
Import an external trace¶
In Observe โ SuperTrace, choose Imported traces โ Import trace from file. Select one OTLP/HTTP JSON file up to 512 KiB, with up to 100 traces and 2,000 spans. The preview shows the trace and span counts and how many traces have a failed root span. Choose Import metadata to save it to the open project. A second import of the same trace metadata reuses the saved entry.
The imported timeline keeps span relationships, timings, statuses, recognized operation types and reported token counts. It uses local identifiers and discards span names, free-text attributes, events, links and raw file content. Choose Remove on an imported trace to delete its timeline from the project.
Create a regression case from a coding session¶
Open a failed coding session or a failed imported trace and choose Create regression case. Select a failure category and write the expected behavior. Save regression case separately approves using the structural failure record and your description as evaluation evidence. The approved case is stored separately from the imported timeline.
For an application defect or model protocol failure, choose Set up experiment, select a Factory binding, and provide a reviewed held-in suite task that reproduces the issue. The existing comparison runs that task against the baseline and candidate before using held-out tasks. A candidate proceeds only if the held-in task fails on the baseline and passes on the candidate. Choose Withdraw on the case to stop authorizing future experiments.
Recorded CLI harness runs¶
Export one saved harness run as metadata-only OTLP JSON:
sq harness observability export RUN_ID --otlp-json > trace.json
Use --store if the run uses a different harness store. This explicit command reads the saved run and writes JSON to stdout. It starts no recorders or sinks. An OTLP/HTTP JSON receiver can ingest the file.