Check code and keep it
Code that is tested, kept and run by ID.
Send a Python function and its tests to Duplex’s isolated execution service, read exactly which tests passed, keep the function as a versioned skill and run it on fresh inputs. When a result is wrong, Duplex helps pin down why.
Check a function against its tests.
Give the Python function and tests that state the expected results, and ask your AI to verify them in Duplex’s isolated execution service. When the material and permissions are there, the start of the turn can even offer a ready check. A favourable comment from an agent after reading the code is not an execution.
| Utfall | What it means |
|---|---|
| Tests passed | This version produced the expected results on the listed inputs. Read its certificate and compare the tested conditions with your use. |
| An expectation differed | It ran and at least one result missed. Ask for the input, actual output and expected value side by side. |
| Execution error | It raised an error before returning. Check input names, types and dependencies. |
| Refused or unavailable | It never ran, so the outcome is unknown. Read whether access, setup, allowance or redaction stopped it. |
A test whose expected value was copied from the function’s own output proves little. Take the expected answer from your source. A failing input can join the next version’s tests.
Run a kept function by its ID.
A function that relies on another kept function can declare that dependency in its check, so both are exercised together and the certificate names the earlier function. If that function later changes, the recorded dependency tells you what to revisit.
| Läs | Why |
|---|---|
| ID and purpose | Two similar skills can have different histories. The ID picks the right one. |
| Bound inputs | The names your values were given under. Differences show here. |
| Output of this run | The value or error from this run. The certificate describes the verified function; this record is today’s result. |
Versions and value.
Versions for the same purpose stay together. Find a skill by purpose and read which version is offered, what it replaced, its use and why it was chosen. An earlier version can still be called by ID while it runs; keep the version ID you used in a study.
If a module has several functions, name the entry function and that’s the one kept. Otherwise Duplex picks from the functions the tests exercise and the module’s external entry, and the card says which it chose and why.
When a version struggles on certain inputs, another version for the same purpose can be tried on those same inputs, and its results there support a change in the offer. The card shows verification time, actual runs, builds answered without new verification and sessions that used it.
Fetch a function as a file.
The card shows the length and checksum of the kept text. A long function comes in parts: fetch them from one version, in order, and if the length and checksum match the card, the text arrived intact. A client with local file access can use the offered file-apply action. If you change the local copy, it’s a new version: run the tests again.
When a skill returns the wrong result.
Run a kept Python skill with the known correct result as the expected value, sent separately from the inputs, or with a kept checker that returns true, false or no judgment. The run then answers the question that matters: did this version, on this input, meet this criterion?
A contradiction can start a background investigation of that version, comparing the failing input with a known working one. If no working case is recorded, the answer asks for one with a trusted value.
| Finding | How to read it |
|---|---|
proved | A single condition or a combination was found. Read the values tested and the inputs held fixed. |
open | The failure didn’t repeat, the working case stopped working, or results varied. Not a basis for a restriction. |
undecided | A combination may be invalid, conditions may cancel out, or an expected value is absent. Fill in only answers you can establish. |
Who can restrict a version.
A finding alone never blocks execution. A steward with skill-limiting authority, or an administrator, can choose a proved diagnosis and restrict the affected version at exactly the inputs shown wrong. If another version was judged correct there, the refused request can name it. An authorized person can lift the restriction.
NumPy, pandas and SciPy for your team.
The prepared scientific profile includes NumPy, pandas and SciPy. Being in the profile and being allowed to run for your team are separate: when your AI hits a missing grant, it follows the returned action to request one, naming the package, version, source, environment and team.
The requester can’t approve their own request. The person the organization owner designates approves or denies it, with its duration and scope in view, on the Python libraries screen. A different team can’t use the grant, even with the skill ID. A denied request runs nothing.
The package environment runs without network access or a cloud identity, so any data must arrive as an authorized input. When a grant expires or is revoked, new runs stop; the card and earlier evidence stay readable. A new package version is a new environment: run the check again.
For a report, keep four things together: the function revision, the package and environment versions, the data revision and the execution receipt.
Instruktioner som en AI-agent följer för att använda den här delen av MatterSpace Duplex på rätt sätt. Klistra in dem i agentens instruktioner, eller peka den mot den här sidans markdown.
Verifying code
Send the function and its tests through the verify path offered by Duplex (duplex_skill with your candidate and tests, or the ready check the turn offers). Report passed, failed (with input, actual and expected), execution error or refusal with its reason. A refusal means the outcome is unknown, not failed.
Running kept functions
Read the card with duplex_skill {op: "show"}, then op: "run" with the skill ID and inputs under their declared names. Report the output of this run and the version used.
Expected values and checkers
When the user knows the correct answer, pass it as the expected value, separate from the inputs. Or name a kept checker. Report agreement, contradiction, or no comparable value (invalid input, timeout, busy).
Packages
If a package grant is missing, follow the returned request action and tell the user who must approve. Never try to approve your own request. Never fetch data from the network inside a package run.
Fetching text
Fetch all parts from the same version, in order, and compare length and checksum with the card before saying the copy is complete.
Never
- Never derive a test's expected value from the function's own output.
- Never claim code "works" from reading it. Only an execution record counts.
Where to find more in the MatterSpace Duplex docs:
- Check code and keep it, this topic in full: https://www.matterspace.ai/duplex/docs/verified-code.md
- Every prompt, and where to paste the standing ones: https://www.matterspace.ai/duplex/docs/prompts.md
- Exact tools, operations, settings and answers: https://www.matterspace.ai/duplex/docs/reference.md
- Errors and what to do about them: https://www.matterspace.ai/duplex/docs/troubleshooting.md
- Every docs page, with what it covers: https://www.matterspace.ai/duplex/docs/llms.txtPromptar för den här sidan
Alla promptar →Kopiera en, fyll i delarna inom vinkelparenteser och ge den till din AI.
Verify this Python function in Duplex's isolated execution service with the tests below. Expected values come from <source>, not from the function. Report each test as passed, failed (input, actual, expected) or error, and give me the certificate ID if it passes and is kept.
<function>
<tests>
Where to find more in the MatterSpace Duplex docs:
- Check code and keep it, this topic in full: https://www.matterspace.ai/duplex/docs/verified-code.md
- Every prompt, and where to paste the standing ones: https://www.matterspace.ai/duplex/docs/prompts.md
- Exact tools, operations, settings and answers: https://www.matterspace.ai/duplex/docs/reference.md
- Errors and what to do about them: https://www.matterspace.ai/duplex/docs/troubleshooting.md
- Every docs page, with what it covers: https://www.matterspace.ai/duplex/docs/llms.txtSkill <skill ID> returned <observed> for <inputs>; the correct answer is <expected> (source: <source>). Run it again with that expected value, and if Duplex opens an investigation, tell me the finding (proved, open or undecided) and which conditions were tested.
Where to find more in the MatterSpace Duplex docs:
- Check code and keep it, this topic in full: https://www.matterspace.ai/duplex/docs/verified-code.md
- Every prompt, and where to paste the standing ones: https://www.matterspace.ai/duplex/docs/prompts.md
- Exact tools, operations, settings and answers: https://www.matterspace.ai/duplex/docs/reference.md
- Errors and what to do about them: https://www.matterspace.ai/duplex/docs/troubleshooting.md
- Every docs page, with what it covers: https://www.matterspace.ai/duplex/docs/llms.txtThis function needs <package> <version>. Check whether my team has a grant in Duplex. If not, file the request through the returned action with the package, version, environment and team, and tell me who has to approve it.
Where to find more in the MatterSpace Duplex docs:
- Check code and keep it, this topic in full: https://www.matterspace.ai/duplex/docs/verified-code.md
- Every prompt, and where to paste the standing ones: https://www.matterspace.ai/duplex/docs/prompts.md
- Exact tools, operations, settings and answers: https://www.matterspace.ai/duplex/docs/reference.md
- Errors and what to do about them: https://www.matterspace.ai/duplex/docs/troubleshooting.md
- Every docs page, with what it covers: https://www.matterspace.ai/duplex/docs/llms.txtFor the Duplex skill with purpose "<purpose>", list its versions: which one is offered now, what it replaced, how each originated, its runs, and why the current one was chosen.
Where to find more in the MatterSpace Duplex docs:
- Check code and keep it, this topic in full: https://www.matterspace.ai/duplex/docs/verified-code.md
- Every prompt, and where to paste the standing ones: https://www.matterspace.ai/duplex/docs/prompts.md
- Exact tools, operations, settings and answers: https://www.matterspace.ai/duplex/docs/reference.md
- Errors and what to do about them: https://www.matterspace.ai/duplex/docs/troubleshooting.md
- Every docs page, with what it covers: https://www.matterspace.ai/duplex/docs/llms.txt
