vibe-sketcherDocumentation

vibesketcher.server.build_review

REST routes for previewing, applying and undoing periodic builds (#201).

POST /api/documents/{id}/periodic/build keeps adding a structure directly. These routes put the same recipes behind the reviewed contract of the other builder forms: .../periodic/build/preview reads the current document and changes nothing; .../periodic/build/apply adds the previewed structure, checked against the document revision, the recipe digest and optionally the input digest; .../periodic/build/undo removes it again while it is unchanged and nothing refers to it. Refusals carry the stable codes of vibesketcher.document.build_review.CODES.

Functions

router(store)

Classes

BuildApplyRequest(*[, actor, client, ...])

BuildPreviewRequest(*, recipe[, structure])

A preview reads the current document; the answer names its revision.

BuildUndoRequest(*[, actor, client])

class vibesketcher.server.build_review.BuildPreviewRequest(*, recipe, structure=False)[source]

Bases: BaseModel

A preview reads the current document; the answer names its revision.

Parameters:
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

recipe: dict[str, Any]
structure: bool

Also return the full derived structure as derived.

class vibesketcher.server.build_review.BuildApplyRequest(*, actor='agent', client='rest', revision, recipe, recipe_sha256, inputs_sha256=None)[source]

Bases: RevisionRequest

Parameters:
  • actor (Literal['human', 'agent', 'system'])

  • client (Annotated[str, _PydanticGeneralMetadata(pattern='^[a-z0-9][a-z0-9_.:+-]{0,63}$')])

  • revision (int)

  • recipe (dict[str, Any])

  • recipe_sha256 (Annotated[str, _PydanticGeneralMetadata(pattern='^[0-9a-f]{64}$')])

  • inputs_sha256 (Annotated[str | None, _PydanticGeneralMetadata(pattern='^[0-9a-f]{64}$')])

recipe: dict[str, Any]
recipe_sha256: str
inputs_sha256: str | None
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class vibesketcher.server.build_review.BuildUndoRequest(*, actor='agent', client='rest', revision, structure)[source]

Bases: RevisionRequest

Parameters:
  • actor (Literal['human', 'agent', 'system'])

  • client (Annotated[str, _PydanticGeneralMetadata(pattern='^[a-z0-9][a-z0-9_.:+-]{0,63}$')])

  • revision (int)

  • structure (str)

structure: str
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

vibesketcher.server.build_review.router(store)[source]
Parameters:

store (Store)

Return type:

APIRouter