modus
Menu
On this page

The entry projects

The exports of the projects service that act for the principal of the caller.

See: Declarations: Projects in the repository

projects module with an entry

Hash
681f733744d93c908a25050725e3fc9d9ca9ff01a1ae5a7f436596a7eb6d7605
Size
167936 bytes
Exports
7
Imports
0
Imported by
0
License
MIT

The exports of the projects service that act for the principal of the caller

FactValue
KindModules with an entry
Sourcesrc/modules/system/projects
Boot imageyes: in the boot image, 167936 bytes in this build
Build settingsnone: the defaults of the source
Importsnone
Imported bynone

Neighbours

It imports no module, and no module imports it. The module graph shows it with the other modules that have no edge.

Exports

ExportWhat it does
load(tree_name: Text, project_evaluation: Bytes(Read), pins_lex: Bytes(Read)) -> Integerreads a project for the principal of the caller: the evaluation of its project.lex, which the evaluation process gave, and its pins.lex
update(project_name: Text, input_name: Text, target: Pin_Target, summary: Table(Pin_Update_Row, Append), pins_lex: Bytes(Append)) -> Textmoves one input of a loaded project of the principal of the caller to a new tree hash
pins(project_name: Text) -> Table(Pin_Row)gives the pinned inputs of a loaded project of the principal of the caller, in the order of pins.lex
build_recipe(project_name: Text, head: Table(Recipe_Head, Append)) -> Table(Recipe_Input_Row)gives the recipe of the inputs tree of a project of the principal of the caller: the builder that the recipes service runs itself, and one input for each pin: a tree, by the tree hash that pins.lex gives it, under the name of the pin
status(out: Projects_Status) -> Integerwrites aggregate projects service counters into out
active_console_count() -> Integerreturns the number of currently open child consoles
pin_count() -> Integerreturns the pins of the last pins.lex that a command List_Inputs read whole, or 0 before the first one
entry()initializes the delegated projects service ring and serves project input, update, enter, and exit commands until stopped

load

load(tree_name: , project_evaluation: (Read), pins_lex: (Read)) -> 

load reads a project for the principal of the caller: the evaluation of its project.lex, which the evaluation process gave, and its pins.lex.

  • tree_name: the name of the project, a Lex name.
  • project_evaluation: the canonical output of the evaluation of project.lex, whose value is a project with a field source.
  • pins_lex: the text of pins.lex; empty for a project with no input.

The result is the count of pins, or a negative number with an error record: ERROR_NO_CALLER, ERROR_ACTS_FOR_PRINCIPAL, ERROR_NOT_READY, or ERROR_PROJECT with the refusal as the value found.

Parameters
  • tree_name:
  • project_evaluation: (Read)
  • pins_lex: (Read)
Result
When it fails
a negative result, and the error record
Source
src/modules/system/projects/exports.odin:126

update

update(project_name: , input_name: , target: , summary: (, Append), pins_lex: (Append)) -> 

update moves one input of a loaded project of the principal of the caller to a new tree hash.

  • project_name: the name that load gave the project.
  • input_name: the name of the input in pins.lex.
  • target: the new tree hash of the input.
  • summary: one row: the count of lines of pins.lex that changed, 0 or 1, the number of that line, and the old and the new tree hash.
  • pins_lex: the whole new pins.lex, for the caller to write in the store of the project.
  • result: the line that changed, as "-" and the old line, then "+" and the new line, each with its line end; empty when nothing changed.

The result is the count of bytes of the changed line text, or a negative number with an error record: ERROR_NO_CALLER, ERROR_ACTS_FOR_PRINCIPAL, ERROR_NOT_READY, or ERROR_PROJECT with the refusal as the value found.

Parameters
  • project_name:
  • input_name:
  • target:
  • summary: (, Append)
  • pins_lex: (Append)
Result
When it fails
a negative result, and the error record
Source
src/modules/system/projects/exports.odin:172

pins

pins(project_name: ) -> ()

pins gives the pinned inputs of a loaded project of the principal of the caller, in the order of pins.lex.

The result is the count of pins, or a negative number with an error record: ERROR_NO_CALLER, ERROR_NOT_READY, or ERROR_PROJECT with Unknown_Project as the value found.

Parameters
  • project_name:
Result
()
When it fails
a negative result, and the error record
Source
src/modules/system/projects/exports.odin:249

build_recipe

build_recipe(project_name: , head: (, Append)) -> ()

build_recipe gives the recipe of the inputs tree of a project of the principal of the caller: the builder that the recipes service runs itself, and one input for each pin: a tree, by the tree hash that pins.lex gives it, under the name of the pin. The caller registers it with recipes.register and builds it with recipes.build.

  • project_name: the name that load gave the project.
  • head: one row: the builder hash and the output kind Tree.
  • result: one row for each input, in the order of pins.lex.

The result is the count of inputs, or a negative number with an error record: ERROR_NO_CALLER, ERROR_NOT_READY, or ERROR_PROJECT with the refusal as the value found: Unknown_Project, Pin_Not_Found for a project with no pin, Store_Failed and Store_Damaged for the private store.

Parameters
  • project_name:
  • head: (, Append)
Result
()
When it fails
a negative result, and the error record
Source
src/modules/system/projects/exports.odin:285

status

status(out: ) -> 

status writes aggregate projects service counters into out.

Parameters
  • out:
Result
When it fails
a negative result, and the error record
Source
src/modules/system/projects/main.odin:61

active_console_count

active_console_count() -> 

active_console_count returns the number of currently open child consoles.

Parameters
none
Result
When it fails
a negative result, and the error record
Source
src/modules/system/projects/main.odin:81

pin_count

pin_count() -> 

pin_count returns the pins of the last pins.lex that a command List_Inputs read whole, or 0 before the first one. A pins.lex that the service refuses does not change it.

Parameters
none
Result
When it fails
a negative result, and the error record
Source
src/modules/system/projects/main.odin:92

entry

entry()

entry initializes the delegated projects service ring and serves project input, update, enter, and exit commands until stopped.

Form
The entry of the module: one parameter, an address, fixed by the contract.
Source
src/modules/system/projects/main.odin:275

Read from the source of the module, as the build reads it to describe the exports (tools/modustool/build/describe.odin).

What the root service gives it

WhatValueAs the root service says
GrantsThe holder of the role Projects: the pins of each project in its private store. See: Declarations in the repository
Other terms of its start grant seton_demand = true
Budget that it asks for
  • working memory pages 256
  • pages of its threads 72
  • pages of the pictures of its window 0
  • pages of the module and its imports from the files of the build
  • processes 1
  • threads 1
Working memory budget for the freestanding projects service process.

The start grant set is read from start_grant_sets in src/modules/system/root/start_grant_sets.odin. The stated budget is read from the constant MODULE_BUDGET of the source of the module (its line); the build adds the counted parts and writes the sum in the module (tools/modustool/build/budget_count.odin); the root service accepts it up to the largest budget of a process, and adds the limits of processor time and of log records (src/modules/system/root/budgets.odin).

Text wire form

A wire form of the module contract: one word of a call. The address of a slice record {address, count} of UTF-8 bytes.

Bytes wire form

A wire form of the module contract: one word of a call. Bytes with no description.

Integer wire form

A wire form of the module contract: one word of a call. A signed integer of 64 bits, in a register.

Error_Record record of a module

A record of the module projects: 56 bytes, aligned on 8 bytes, 0 bytes of padding.

  • kindi6408 bytes
  • uniti6488 bytes
  • operationi64168 bytes
  • argumenti64248 bytes
  • valuei64328 bytes
  • limiti64408 bytes
  • foundi64488 bytes

Pin_Target record of a module

A record of the module projects: 32 bytes, aligned on 1 bytes, 0 bytes of padding.

  • tree_hashHash(32)032 bytes

Table wire form

A wire form of the module contract: one word of a call. Records of one description that follow each other (a table).

Pin_Update_Row record of a module

A record of the module projects: 80 bytes, aligned on 8 bytes, 0 bytes of padding.

  • changed_linesi6408 bytes
  • line_numberi6488 bytes
  • old_tree_hashHash(32)1632 bytes
  • new_tree_hashHash(32)4832 bytes

Pin_Row record of a module

A record of the module projects: 256 bytes, aligned on 1 bytes, 0 bytes of padding.

  • tree_hashHash(32)032 bytes
  • source_module_hashHash(32)3232 bytes
  • nameText(64)6464 bytes
  • upstream_refText(128)128128 bytes

Recipe_Head record of a module

A record of the module projects: 56 bytes, aligned on 8 bytes, 0 bytes of padding.

  • output_kind_wordi6408 bytes
  • source_date_unixi6488 bytes
  • output_block_limiti64168 bytes
  • builder_hashHash(32)2432 bytes

Recipe_Input_Row record of a module

A record of the module projects: 104 bytes, aligned on 8 bytes, 0 bytes of padding.

  • kind_wordi6408 bytes
  • hashHash(32)832 bytes
  • nameText(64)4064 bytes

Projects_Status record of a module

A record of the module projects: 48 bytes, aligned on 8 bytes, 0 bytes of padding.

  • total_inputs_queriesi6408 bytes
  • total_updatesi6488 bytes
  • total_entersi64168 bytes
  • total_exitsi64248 bytes
  • active_consolesi64328 bytes
  • total_refusalsi64408 bytes