Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugins/fxtr/.codex-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fxtr",
"version": "0.1.5",
"version": "0.1.6",
"description": "Write, run, and view fxtr experiments, and call models from them with behaviors.",
"author": {
"name": "Transluce",
Expand Down
8 changes: 4 additions & 4 deletions plugins/fxtr/skills/behaviors/provenance.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
"skill": "behaviors",
"documentation": "https://docs.transluce.ai/behaviors",
"packages": {
"fxtr": "0.2.0a0",
"behaviors": "0.0.1a5"
"fxtr": "0.2.0a1",
"behaviors": "0.0.1a6"
},
"revision": "6432f6ad1682ca0a8ff344a6ef66cb09bbccb8f7",
"revision": "ffd2e4fd4515a3102de1a6bc4915d75831822eea",
"modified": false,
"content_sha256": "f67fdb291628ed957c6fa39d933926312c3c3864bea083e28264c69666da8d96"
"content_sha256": "2f7c10c745c1a4fa5df386e2417cf07fe36a43d25b95b4460eb625b4bbe00407"
}
16 changes: 15 additions & 1 deletion plugins/fxtr/skills/behaviors/references/reference/api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ async def judge_run(
),
sampling=sampling.params,
custom_formats=[AGENT_RUN_LINE_CITATION_FORMAT],
preview=context.preview,
)
finally:
await api.aclose()
Expand Down Expand Up @@ -408,6 +409,19 @@ The arguments:
written once.
* **`sampling`** is the sampling parameters for each call, and **`callback`**, if given,
receives the events of each call when the model API can stream.
* **`preview`**, if given, receives the judgment so far, so you can watch it in the viewer while
its step runs. In a step, pass `preview=context.preview`. It receives a function that builds a
partial `Judgment` (see [Partial values](../../../fxtr/references/concepts/entities-and-custom-types.mdx#partial-values)),
so the value is built only when the viewer's copy is saved. In it, `entity_ids` is set, and
`output` and `citations` are `None`. `attempts` holds a partial `JudgeAttempt` for each finished
attempt, with its `response` and `invalid_output_reasons`, then one for the attempt in flight,
whose `response` is a partial `ModelResponse` holding the answer so far (`None` before the
answer starts). Each attempt's `request` is `None`: every request repeats the entities, so the
preview leaves them out, and the judgment `judge` returns keeps them. With the behaviors
renderers (`behaviorsRenderers` from `fxtr-view-behaviors`) registered, the step's panel shows
the judge's answers so far, each invalid one with what was wrong, ending in the answer being
written, and its row in the run's table says which attempt it is on ("attempt 2 · 1 invalid ·
streaming…"). When `judge` returns, the step's result takes the preview's place.
* **`max_answers`** is how many answers the model gets, 3 by default. An answer that is not
accepted goes back to the model with what was wrong, until it has given this many.
* **`retry`** and **`failure_categories_to_retry`** say when a failed call is made again. By
Expand All @@ -417,7 +431,7 @@ The arguments:
failed calls, the two multiply: pass `retry=RetryConfig(max_attempts=1)` to make each call
once.

All of these but `callback` change what a judgment can come out as. In a step, pass the ones you
All of these but `callback` and `preview` change what a judgment can come out as. In a step, pass the ones you
vary as step inputs, so the judgment points at the settings that produced it and the step cache
sees each one: `sampling` in a sampling entity of the project's own, as the example does, and
`max_answers` as a number. A setting kept in the step's code, such as `retry`, is invisible to the
Expand Down
6 changes: 3 additions & 3 deletions plugins/fxtr/skills/first-experiment/provenance.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
"skill": "first-experiment",
"documentation": null,
"packages": {
"fxtr": "0.2.0a0",
"behaviors": "0.0.1a5"
"fxtr": "0.2.0a1",
"behaviors": "0.0.1a6"
},
"revision": "6432f6ad1682ca0a8ff344a6ef66cb09bbccb8f7",
"revision": "ffd2e4fd4515a3102de1a6bc4915d75831822eea",
"modified": false,
"content_sha256": "a940ab9c02eec8a663fd3ef94d622a4dc88c9a42b4d5f7faa777c4c90b3e340a"
}
24 changes: 18 additions & 6 deletions plugins/fxtr/skills/fxtr/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,10 @@ before [adding one](references/reference/renderers.mdx#adding-a-package-to-a-pro
the viewer's URL (the one `fxtr view` printed, also saved in `.fxtr/viewer.json` within the project), then `#` and `&`-separated parts.

```
http://127.0.0.1:8000/#job=<job id>&w=flowchart(/outer,model=sonnet)&slice=(prompt=3)&card=judge&p=table(/outer/judge,model=sonnet)&p=.output.transcript
http://127.0.0.1:8000/#job=<job id>&p=table(/outer/judge,model=sonnet)&p=.output.transcript
```

`job` is the job's ID (left out, the newest job). `w` is the workflow invocation shown (left
out, the root's trace): `trace`, `flowchart`, or the id of an `InvocationPanel` renderer
of that workflow, applied to its step path from the root, with the keys of the mapped workflows
on the way. `slice` picks dim values for every card and panel. `card` names a step of that workflow (or
`return`, what it returned) whose card to scroll to. Each `p` opens a panel, in order,
`job` is the job's ID (left out, the newest job). Each `p` opens a panel, in order,
each following the one before it; `pin` opens one that stays as it is. A panel is an address,
a view applied to a location and params: the view is `table`, `invocation`, `tree`, `code`, a
renderer's or page's id, or nothing for the default; the location is a step path from the root
Expand All @@ -158,6 +154,22 @@ before [adding one](references/reference/renderers.mdx#adding-a-package-to-a-pro
panel, a location may be relative to the panel before it: `.field…` below it, `../step` a
sibling. Percent-encode only spaces, `%`, `&`, `#`, `+`, and quotes.

A panel on a step is enough to show where the step is: the link opens on the trace of the
workflow that step is in, scrolled to its card, so bind the keys of the mapped workflows on the
way (`model=sonnet` above) in the panel or the slice. Three more parts say otherwise:

```
http://127.0.0.1:8000/#job=<job id>&w=flowchart(/outer,model=sonnet)&slice=(prompt=3)&card=judge
```

`w` is the workflow invocation shown: `trace`, `flowchart`, or the id of an `InvocationPanel`
renderer of that workflow, applied to its step path from the root, with the keys of the mapped
workflows on the way. Left out, it is the trace of the workflow the first panel's step is in,
or the root's when no panel shows a step. `card` names a step of the workflow shown (or
`return`, what it returned) whose card to scroll to, which points at a step without opening a
panel; left out, it is the first panel's step. `slice` picks dim values for every card and
panel.

### Reading the documentation

* **Know which documentation you have.** Distributed in the fxtr plugin for Claude Code or
Expand Down
8 changes: 4 additions & 4 deletions plugins/fxtr/skills/fxtr/provenance.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
"skill": "fxtr",
"documentation": "https://docs.transluce.ai/fxtr",
"packages": {
"fxtr": "0.2.0a0",
"behaviors": "0.0.1a5"
"fxtr": "0.2.0a1",
"behaviors": "0.0.1a6"
},
"revision": "6432f6ad1682ca0a8ff344a6ef66cb09bbccb8f7",
"revision": "ffd2e4fd4515a3102de1a6bc4915d75831822eea",
"modified": false,
"content_sha256": "3188553424bccd6a1a5b64c814bec89797e7468678f4d4e0fed6540d89636780"
"content_sha256": "30bbe477cf9e20e59e52521a3f36b677662b1b7e46cd6421431cc5e04bd208ea"
}
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,7 @@ While it works, a push reports each stage on standard error: exporting the job,
commits, uploading (with how much is sent, for a large record), and on a hub, waiting for the hub
to take it in. `-q` hides these lines. When it finishes, it prints the job's tags, what the remote calls the push (on a hub the job's record CID, on
an OCI registry the digest of the artifact it made), and the command that pulls it. A hub push
also prints the job's visibility when the hub reports it, and the address of the job's page, to
open or to send to whoever should read it. A pull names what to get: on a hub a
also prints the address of the job's page, to open or to send to whoever should read it. A pull names what to get: on a hub a
job, by its id or a tag; on an OCI registry an artifact, by tag or digest. In the other project:

```bash
Expand Down Expand Up @@ -215,32 +214,47 @@ git repository. GitHub does not show these refs among the repository's branches

A fxtr hub keeps a team's published jobs, lists them, and shows each in the experiment viewer in
the browser, with the project's own renderers. A hub project belongs to a GitHub repository, and
takes jobs from any directory of it. Access comes from GitHub: the repository's collaborators
have a role on each of its hub projects, and those who can write to it can publish. The account
that created a project is its admin while it can read the repository, so it can publish there
too.
takes jobs from any directory of it.

**Accounts.** Sign in to the hub with GitHub, or make an account with your email address and a
password. An email account reads public jobs at once; to use your repositories, confirm your
address from the email the hub sends, then link your GitHub account from Account settings.
password. An email account reads public projects at once. Confirm your address from the email
the hub sends: you then have access to each project that is shared with your address, and you
can link your GitHub account from Account settings to use your repositories.
Besides `remote add --create`, the hub's Connect a project page creates a project: pick a
repository you can read, and the hub finds the fxtr projects in it.

**Who reads a job.** Each published job has a visibility:
**Who reads a project.** Each project has a visibility, which covers every job in it.

| Visibility | Who can read the job |
| ---------- | ------------------------------------------------------------------------------------------------------------ |
| `shared` | Everyone with a role on the project: the repository's collaborators, and the project's creator. The default. |
| `private` | Only you, the job's first publisher, while you have a role on the project. |
| `public` | Anyone, signed in or not. They see the project's name and repository, and none of its other jobs. |
| Visibility | Who can read the project and its jobs |
| ---------- | ------------------------------------------------------------------- |
| `private` | Only people who have been given access to the project. The default. |
| `public` | Anyone, signed in or not. |

Publishing always needs a role, also on a public project. A project admin changes the
visibility on the project's Sharing page on the hub (`/projects/<id>/sharing`), or with
`fxtr hub visibility`.

**Who has a role.** A role says what a person may do on a project: a reader reads it, a
contributor also publishes jobs and creates tags, a maintainer also moves tags, and an admin
also changes the project's visibility and who it is shared with. By default, roles come from
GitHub. A collaborator of the project's repository has their permission there as their role
(read or triage: reader; write: contributor; maintain: maintainer; admin: admin). The account
that created a project is its admin while it can read the repository.

A project admin can also share the project with a person directly, on the project's Sharing
page: enter the person's email address or GitHub username, and choose a role. The person does
not need access to the repository. A role given this way replaces the person's GitHub
permission on that project, so it can be higher or lower. When an admin removes it, and the
project is shared with the person in no other way, the person has their GitHub permission again. A project shared with an email address gives its role to the hub account
that confirmed that address; the person can make the account after the project is shared.

The hub holds each job once. A push sends the job's record, and the hub merges it into its copy
of the job, so the job's page on the hub keeps its address as the job grows; a push prints the
hub's *record CID* after it, the content id of the record the hub now exports of the job.
Tags are names on the hub that point at jobs. A pull names the job by its id, and gets it as
the hub holds it; a tag gets the job it points at (`tag:TAG` when the tag
looks like a job id). The job's id can carry the repository, as `OWNER/REPO/JOB`, in a push, a
pull, or a visibility change: it is checked against the checkout's repository, which guards
looks like a job id). The job's id can carry the repository, as `OWNER/REPO/JOB`, in a push or a
pull: it is checked against the checkout's repository, which guards
against a job id pasted into the wrong checkout. Pushing a job again after resuming it brings
the hub's copy up to date, and the hub refuses it if someone else pushed the job since; pull the
job with `--update`, then push again (the same rule `fxtr jobs import --update` follows). If two
Expand All @@ -265,14 +279,9 @@ built bundle leaves the job's renderers on the hub as they are.
uv run fxtr push JOB --tag baseline
uv run fxtr pull JOB # the job as the hub holds it
uv run fxtr pull baseline # by tag
uv run fxtr push JOB --visibility private # set who can read the job
uv run fxtr hub visibility JOB public # change it without pushing
uv run fxtr hub visibility public # let anyone read the remote's project and its jobs
```

You can set any visibility on a job you first published. A project admin can make a job they
can read `shared` or `public`, but cannot make someone else's job `private`. A tag never names a
job that the person setting it cannot read.

**Renderers.** [Some browser features are not available to renderers on a hub](../reference/renderers.mdx#what-renderers-can-do-on-a-hub).
The hub shows a job with the renderers its push attached: the project's built
view bundle at the time of the push (`fxtr views build`), stored once per build. That code was
Expand Down
12 changes: 5 additions & 7 deletions plugins/fxtr/skills/fxtr/references/reference/cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,7 @@ See [Pushing and pulling jobs](../guides/pushing-and-pulling-jobs.mdx) for how r
tags you give; moving a tag that names another job needs the maintainer role. A push also
sends how the job's attempts went (their errors and logs) and the project's built view
bundle, and prints the id of the record the hub now exports of the job and the address of
the job's page. `--visibility
private|shared|public` sets who can read the job. Without it, a job's first push makes it
`shared`, and a later push keeps the job's level.
the job's page. Who can read the job is the project's visibility (`fxtr hub visibility`).
</ResponseField>

<ResponseField name="fxtr pull REF">
Expand All @@ -204,8 +202,8 @@ See [Pushing and pulling jobs](../guides/pushing-and-pulling-jobs.mdx) for how r
to an access token made on the hub's account page (Computers and tokens).
</ResponseField>

<ResponseField name="fxtr hub visibility JOB LEVEL">
Set who can read a published job on the hub: `private` (only its first publisher), `shared`
(everyone with a role on the project), or `public` (anyone). Takes `--remote` like
`fxtr push`.
<ResponseField name="fxtr hub visibility LEVEL">
Set who can read a hub remote's project and every job in it: `private` (only people who have
been given access) or `public` (anyone, signed in or not). You must be an admin of the project.
Takes `--remote` like `fxtr push`.
</ResponseField>
Loading