The ownership panel
The Actus Ownership panel in VS Code, read on one real program. For each verb it shows every participant with its role and state, the views and loans, what happened to each one, and the cleanup in order.
An Actus program says, at every call, who takes part and how: erg is the
owner that acts, abs only looks, ins is lent for the call and comes back,
dat is handed over for good. The compiler follows each participant through
the verb and knows, at every line, in which state it is: active, moved, frozen
by a view, suspended by a loan, or dropped. The panel shows that record.
The Actus Ownership panel is a panel of VS Code, next to Terminal and Problems. For each verb of the open file it lists:
- every participant, with its role and its type,
- every view and every loan,
- what happened to each participant, in the order the compiler recorded it: moved, dropped, frozen, released, loaned, returned, restored, joined,
- the cleanup at the end of each scope, in the order it runs.
The panel shows facts of the compiler and nothing else. It never works out ownership from the text of the file. If the compiler cannot say, the panel says so, as described in When the file does not check.

The picture shows the panel on wire_parser_finish of the standard library.
The cursor is on line 189, so the rows of decoded have a green background and
the other rows are dim. The bracket
on the left joins payload_output with its loan to wire_frame_decode and its
return. Each row ends with the state and the line.
Open the panel
Use one of these:
- Run Actus: Show Ownership Chain Graph from the Command Palette.
- Choose Show Ownership Chain Graph in the Quick Actions of the status bar.
- Click the tab Actus Ownership in the panel area.
The panel has one view, called Ownership Chain Graph. It follows the Actus
file that is active in the editor. If the active editor is not an Actus file,
it follows another Actus file that is visible. With no Actus file at all it
says Open an Actus file that checks with the language server running.
The panel asks the language server again when you switch files, 250 ms after you stop typing, when you save, when the server has started, and when you press Refresh. It sees the text in the editor, so unsaved changes count.
One program
The program below has two Buffer owners, an abs view, two ins loans, a
hand-off with dat, numbers, and an if that hands the buffer over in one
branch. All the examples on this page are checked with Actus 0.3.0, and the
rows in the tables are what the language server of that compiler sends to the
panel.
limit is 3, so the else branch runs: view is a view of log, and the
program prints the byte that record appended, the letter A.
With this file open, the panel shows this. The top of the panel is a toolbar
with a badge main.act · 8 bindings, a search field, the filters
All erg abs ins dat drop, and the buttons Collapse All, Focus
Cursor and Refresh. Under it comes one section for each verb. The header
of a section reads verb record, the number of rows, the state Scope and the
place of the verb, Ln 1:1.
verb record, 2 events, Ln 1:1
| Role | Row | Detail | State | Line |
|---|---|---|---|---|
ins | log: Buffer | Declared as ins | Active | 1:13 |
abs | reading: u8 | Scalar value (abs) | Value | 1:30 |
verb archive, 2 events, Ln 5:1
| Role | Row | Detail | State | Line |
|---|---|---|---|---|
dat | log: Buffer | Declared as dat | Active | 5:14 |
drop | drop log | Compiler cleanup plan (LIFO) | Dropped | 7:2 |
verb main, 15 events, Ln 9:1
| Role | Row | Detail | State | Line |
|---|---|---|---|---|
erg | limit: Int | Scalar value (erg) | Value | 10:5 |
erg | log: Buffer | Declared as erg | Active | 11:5 |
erg | note: Buffer | Declared as erg | Active | 12:5 |
ins | ins log -> record(log:) | Exclusive ins loan to record(log:) (Active -> Suspended) | Suspended | 13:21 |
ins | returned log | Exclusive ins loan returned (Suspended -> Active) | Active | 13:44 |
ins | ins note -> record(log:) | Exclusive ins loan to record(log:) (Active -> Suspended) | Suspended | 14:21 |
ins | returned note | Exclusive ins loan returned (Suspended -> Active) | Active | 14:45 |
erg | total: Int | Scalar value (erg) | Value | 16:9 |
dat | dat log -> archive(log:) | dat argument to archive(log:) (Active -> Moved) | Moved | 16:38 |
erg | restored log | Branch start (if) (Moved -> Active) | Active | 19:12 |
abs | view: Buffer | Declared as abs | Active | 20:9 |
abs | frozen log | abs view started (Active -> Frozen) | Frozen | 20:9 |
abs | released log | abs view ended (Frozen -> Active) | Active | 22:6 |
drop | drop note | Compiler cleanup plan (LIFO) | Dropped | 23:2 |
drop | drop log | Compiler cleanup plan (LIFO) | Dropped | 23:2 |
The panel draws these as rows of one list, with a role badge on the left, the
row text, the detail in a lighter colour, a state label and the position on the
right. The tables show the same columns. Here is main, row by row.
limit: Int. A number is a value, not a participant. It has no role in the sense of the model and no state: the label saysValue, and it has no cleanup and no connector. The same is true ofreading: u8inrecordand oftotal: Int.log: Buffer. The ownerlog, declared asergon line 11. Its type is written after the name. This row is the start oflog.note: Buffer. A second owner.ins log -> record(log:). Line 13, column 21 is thelogafterinsin the call. The call lendslogtorecordfor its parameterlog. While the call runs,logis Suspended: nobody else may read it or change it.returned log. The call has ended. The place is the end of the call, column 44, at the;.logis Active again, with the byte thatrecordappended.- and 7. The same loan and return for
note. The call names the parameterlogofrecord, so the text isrecord(log:)for both. total: Int. A number declared in the first branch of theif.dat log -> archive(log:). Thedatargument on line 16. The owner handslogover toarchivefor good. The state after it is Moved. This is the end oflogon this path: the branch returns on the next lines.restored log. Line 19, at the{of theelse. Theelsebranch does not follow the first branch. It starts from the state before theif, sologgoes from Moved back to Active. The detail says why:Branch start (if).view: Buffer. The bindingview, declared asabs. It holds a view oflogand owns nothing.frozen log. Same place, theref logof the view. While the view exists, the owner is Frozen: it cannot change and cannot be handed over. The row is anabsrow, because the view is what freezes it.released log. Line 22, right after the}that ends theelseblock. The view ends with its scope, andlogis Active again.- and 15.
drop note,drop log. The cleanup of the verb, at line 23, just after its closing brace, in this order: the owner that was declared last is released first (LIFO).limit,totalandviewhave no cleanup row: the first two are values and the third is a view, which ended at row 13.
The rows are sorted by position in the file. Rows at the same position keep the
order in which the compiler gave them, which is why view: Buffer comes before
frozen log.
Now record and archive. In record, log is an ins parameter: the verb
may change it, and the owner is the caller, so the verb has no cleanup row for
it. In archive, log is a dat parameter: the verb owns it, and it must be
released at the end, so the panel has the row drop log at line 7, column 2,
just after the closing brace.
Where the rows come from
The panel sends two requests for the open file: actus/memoryGraph and
actus/semanticModel. The memory graph has the nodes, the edges and the
transitions. The semantic model is used for one thing only: the type that is
written after a name in a declaration row. If that request fails, the rows have
no types.
A binding of the program is a node. This is the node of limit. The compiler
says scalar: true, so the panel writes Value and not the state:
Each event of the history is one entry of transitions, in the order in which
the compiler recorded it. This is row 9, the dat hand-off of log. The line
and the column are counted from 0 in the answer and from 1 in the panel, so
line: 15, character: 37 becomes Ln 16:38:
kind becomes the text of the row, cause becomes the detail, and from and
to become the arrow (Active -> Moved). The cleanup of the verb is a node
with the actions in the order in which they run. The panel makes one row of
each action. This is the cleanup of main; the indices are those of note
(5) and log (4):
The answers are shortened here: each node also has a range. The format is the
one of the language server, described in
Editor support.
Reading a row
Each row has five parts.
| Part | What it says |
|---|---|
| Role | A coloured badge. It is the role of the construct that the row is about. See Roles and colours. |
| Row | The name and the type of a participant (log: Buffer), or what happened (dat log -> archive(log:)). |
| Detail | In a lighter colour. For an event it names the cause and the change of state, for example dat argument to archive(log:) (Active -> Moved). |
| State | The state of the participant after the row. See States. |
| Line | line:column in the file, both counted from 1. The row opens that place when you click it. |
A declaration row has the state that the compiler records for the binding at
the end of its scope, not at the place where it is declared. A binding that is
moved on every path therefore shows Moved in its first row. The rows after it
show how it got there.
The place of a row is where its cause is: the argument of a call for a dat
hand-off, the call for a loan, the ref expression for a view. A row that
ends something (a returned loan, a release, a join, a cleanup) has the place
where the call, the scope or the construct ends.
The header of a verb has the state Scope, or Inactive when the verb is
excluded by the target of the project. The number in it counts the rows of the
verb, declarations included.
Roles and colours
The badge colours are the same as the role colours of the editor.
| Badge | Colour | Used for |
|---|---|---|
verb | #21F1A8 | the header of a verb |
erg | #4ADE80 | an owner: its declaration, its reinitialization, restore and join |
abs | #60A5FA | a view: the declaration of a view, and a view that starts or ends |
ins | #FACC15 | a loan: it starts, and it is returned |
dat | #F472B6 | a hand-off |
drop | #94A3B8 | a release: explicit drop and the cleanup of a scope |
drop is not a role of the language. It is the badge for a release, so that
you can filter for it. A declaration row has the badge of the declared role,
also for a parameter (ins for log in record). A restored or joined
row has the role of the binding.
States
The state label of a row is one of these.
| State | What it means for the participant |
|---|---|
Active | The owner holds the value. It can be read, changed, lent, viewed and handed on. |
Moved | The value was handed over, for example by a dat argument. The name cannot be used until it holds a value again. |
Frozen | A live abs view of the owner exists. Nobody can change it or move it until the view ends. |
Suspended | The owner is lent to a call by ins. Only that call can use it until it returns. |
Dropped | The value was released, by an explicit drop or by the cleanup at the end of a scope. |
PartiallyMoved | A field of the value was moved out. The rest is still owned. |
Value | The row is about a number or a Bool. A scalar is a value and has no state, because it is copied and never moves. |
Scope, Inactive | The header of a verb. |
Frozen and Suspended are states of access to an owner whose ownership is
still Active. When an owner has one of them, the panel shows it instead of
Active, because it is what matters at that place.
What each event is
The compiler records nine kinds of events. Each is caused by one construct of your program.
| Event | Caused by | Role badge | Row text |
|---|---|---|---|
moved | a dat argument, or another place where the value goes to a new owner | dat | dat log -> archive(log:) |
dropped | an explicit drop | drop | dropped log |
reinitialized | a new value for an owner or a field that had moved out | erg | reinitialized log |
frozen | an abs view of the owner starts, as in abs view = ref log | abs | frozen log |
released | that view ends with its scope | abs | released log |
loaned | an ins argument: the owner is lent to the call | ins | ins log -> record(log:) |
returned | the call ends and the owner is back | ins | returned log |
restored | the start of a branch of an if or of an arm of a case: back to the state before it | role of the binding | restored log |
joined | the end of an if, a case or a loop: the paths come together | role of the binding | joined log |
A moved event that has no call as its cause, such as a move into another
owner, is written moved log, and the detail names its cause. A kind of event
or of cause that the panel does not know is shown under its own name.
A loaned or moved row names the callee and the parameter. The parameter
name is the one of the declaration, so two loans of different variables to the
same parameter both read record(log:).
The joined event is recorded only when the path that continues has another
state than the one the analysis has at that point. Here the else branch moves
log and returns, and the code after the if continues from the first branch:
The rows of main:
| Role | Row | Detail | State | Line |
|---|---|---|---|---|
erg | limit: Int | Scalar value (erg) | Value | 6:5 |
erg | log: Buffer | Declared as erg | Active | 7:5 |
erg | total: Int | Scalar value (erg) | Value | 11:9 |
dat | dat log -> archive(log:) | dat argument to archive(log:) (Active -> Moved) | Moved | 11:38 |
erg | joined log | Path join (if) (Moved -> Active) | Active | 14:6 |
drop | drop log | Compiler cleanup plan (LIFO) | Dropped | 16:2 |
The joined row is at the end of the if, line 14 column 6. The path that
moved log leaves the verb, so after the if the owner has the state of the
other path, Active, and the last line may use it.
An explicit drop is its own event, and then the cleanup at the end has nothing
left to do for that owner:
| Role | Row | Detail | State | Line |
|---|---|---|---|---|
erg | log: Buffer | Declared as erg | Dropped | 2:5 |
drop | dropped log | Explicit drop (Active -> Dropped) | Dropped | 4:5 |
The declaration row says Dropped, because that is the state of log at the
end of its scope.
The cleanup rows
At the end of every scope the compiler has a plan of what to release. The panel
shows each action as a row with the badge drop, at the place where the scope
ends, in the order of the plan:
drop logreleases an owner. Owners are released in reverse order of their declaration, last first. Inmainabove,drop notecomes beforedrop log.drop remaining fields of logis used when some fields of a struct moved out. The detail lists them.reset arena nameis the end of an arena.drop log (Enum.Variant.field)releases the payload of an enum value.end view on logappears when a view ends at the end of a scope and noreleasedrow shows it. In the program above thereleasedrow does.
A parameter that the verb does not own, abs or ins, has no cleanup row.
A scalar has none either.
The connectors
At the left of the role badges there is a narrow column. For every participant
that has two or more rows, it draws a thin rounded bracket from each of its rows
to the next one. In main, log is connected from its declaration through the
loan, the return, the hand-off, the restore, the freeze and the release, down to
its cleanup. note has its own connector, and the two run side by side. A
scalar has none, and neither has a participant with only one row, such as
view.
The connectors are pale. When you hold the pointer over a row, or when the cursor of the editor is on a participant, its connectors get brighter and thicker and take the colour of the role of the row where each part starts. The connectors of other participants fade. So you can follow one participant down a long verb.
Pointer, cursor and click
- Hover. The pointer over a row lights up the connectors of its participant.
- Cursor focus. When you move the cursor in the editor, the panel finds the
row whose range holds the cursor. If there is none, it takes the first row on
the same line. The rows of that participant get a green background, and all
other rows become dim. A declaration row covers the whole declaration, so the
cursor anywhere in
erg log: Buffer = Buffer[0];selectslog. - Click on a row. The editor opens the place of the row, selects it, scrolls it into view and marks it for a moment. The participant becomes the focused one.
- Click on a verb header. The section opens or closes, and the editor moves to the verb. The arrow at the left of the header only opens and closes.
Filters, search and buttons
| Control | What it does |
|---|---|
| Search field | Keeps the rows whose text contains what you type: name, type, row, detail, state or role. The case does not matter. |
All erg abs ins dat drop | Keeps the rows with that badge. It combines with the search field. |
| Collapse All | Closes every verb section. The button then reads Expand All. |
| Focus Cursor | Keeps only the rows of the participant under the cursor, while it is switched on. |
| Refresh | Asks the language server again. |
When a filter, a search or Focus Cursor is on, the verb headers are hidden
and only the verbs that have a matching row are shown. If nothing matches, the
panel says No ownership transitions match the current filter.
For example, the filter dat on the program above leaves the declaration of
log in archive and the hand-off in main. The filter drop leaves the
three cleanup rows. The search Frozen leaves frozen log and released log, because the detail
of the second one says Frozen -> Active.
When the file does not check
The panel only describes a package that the compiler accepts. If it does not, the compiler gives no graph and says why, and the panel shows that reason followed by a note. Here the buffer is used after it was handed over:
The reason comes from the compiler. Open in the editor, this file gives the panel only this text, and no rows:
Fix the error and the panel fills in again. The Problems panel has the error in the usual place, with the quick fix Explain Actus E1005.
The other messages are:
| Message | When |
|---|---|
Actus language server is not running followed by the note | the server did not start, or was stopped |
Could not query actus/memoryGraph (...) followed by the note | the request failed |
Unsupported actus/memoryGraph schemaVersion N (expected 1). Please update the Actus VS Code extension. | the compiler speaks a newer schema |
No bindings or ownership events reported by the compiler for this file. | the file has nothing to show |
What the panel does not do
- It shows one file at a time: the active Actus file. The compiler checks the whole package to answer.
- It does not change the file. It has no buttons for fixes.
- It shows the analysis of the compiler, and that is all. If you want to know
why the compiler rejects a program, the error has the explanation and
actus explainhas the long text. See Fixing and explaining errors.
What you learned
- The panel lists, for each verb, every participant with its role, type and state, and every event the compiler recorded for it, in order.
- The states are
Active,Moved,Frozen,SuspendedandDropped. A number or aBoolis a value and has no state. - A
datargument givesMoved, anabsview givesfrozenandreleased, aninsloan givesloanedandreturned, an explicitdropgivesdropped, and anifgivesrestoredandjoined. - The cleanup rows come last in each scope, in reverse order of declaration.
- The rows are the answer of
actus/memoryGraph. When a file does not check, the panel shows the reason of the compiler.
Next: Tests in VS Code.