Skip to content

osy 0.19.12

Choose a tag to compare

@osysharp-publisher osysharp-publisher released this 14 Nov 10:06

This release closes several ways a package or an app could act with more rights than it was given, makes an organisation's outbound-host
policy hold on every path an app sends from, makes app migrations' copy/merge/split/transform lines work again, and makes a commit
that creates many rows with Markdown members much cheaper. To upgrade, run osy upgrade, then osy update in a project.

⚠ Read first

  • ⚠ Agents 2.0.0 (major). An agent now works for the person the platform recorded, never for a person your code names.
    Agents.Of<X>().For(Principal) is removed. App authors change three things:
    • Name the row the work is about, not the person. For(row) works for whoever made row, as its [CreatedBy] stamp records. Add
      the stamp to the entity if it has none, and fill it for the rows you already have with a migration in the same deploy.

      Before (Agents 1):

      var outcome = await Agents.Of<Editor>().For(report.Employee.User).Do(new Summarise(), report.Title, about: report.Title);
      

      After (Agents 2):

      entity Report {
        [CreatedBy] Guid? CreatedBy;
        [Required] Employee Employee;
        string Title = "";
      }
      
      var outcome = await Agents.Of<Editor>().For(report).Do(new Summarise(), report.Title, about: report.Title);
      

      And in the deploy's migration, for the reports made before the stamp:

      migration "reports record their maker" {
        backfill Report.CreatedBy = r => r.Employee.User;
      }
      

      Change every call that passes a person. Agents 2.0.0 still compiles one, but the work is then for whoever made that person's
      account, or for nobody, and then the agent acts alone with its own rights. The kit's next release refuses such a call when it runs.

    • Say where a proposal is answered, and relay the answer, not the person. If your code puts an agent's proposal where a person
      answers it, call AwaitProposalAnswerIn(proposal, row) with that row. RelayProposalDecision now takes the row the person answered
      with, where it took the person. The platform reads who answered from that row's [CreatedBy], and the row must [RollsUpTo] the row
      the proposal was put in. An answer given anywhere else decides nothing. The Agents.HumanRequests bridge does all of this for you.

      Before (Agents 1):

      [On] void PutOnSlip(AgentProposed e) {
        new Slip { Proposal = e.Proposal.Id, Title = e.Proposal.Label };
      }
      
      var person = Principal.FirstOrDefault(p => p.Id == answer.AnsweredBy);
      RelayProposalDecision(proposal, answer.Yes, "", person);
      

      After (Agents 2):

      entity SlipAnswer {
        [Required, RollsUpTo] Slip Slip;
        [CreatedBy] Guid? AnsweredBy;
        bool Yes;
      }
      
      [On] void PutOnSlip(AgentProposed e) {
        var slip = new Slip { Proposal = e.Proposal.Id, Title = e.Proposal.Label };
        AwaitProposalAnswerIn(e.Proposal, slip);
      }
      
      RelayProposalDecision(proposal, answer.Yes, "", answer);
      
    • Move the agents family together. Agents goes to @2, Inspector and Management to @3, and the others to @2.

      Before:

      use Osysharp.Agents@1;
      use Osysharp.Agents.Management@2;
      use Osysharp.Agents.Inspector@2;
      

      After:

      use Osysharp.Agents@2;
      use Osysharp.Agents.Management@3;
      use Osysharp.Agents.Inspector@3;
      
  • ⚠ If you deployed copy X -> Y; together with drop property X; before this release, X's values were removed and not copied. Restore
    them from a backup taken before that deploy.
  • ⚠ A migration line you deployed before this release runs on your next deploy that still carries it. An app migration's copy, merge,
    split and transform lines, and backfill on an optional member, were accepted and did nothing from 29 Jun 2026 through 0.19.11. They work
    again — including a backfill whose value is counted or summed over a related collection — and each writes only the rows of its own type (a
    subtype stored in its base's table no longer touches the base's other rows). Each line runs once per database, on the first deploy that
    carries it. A platform upgrade runs no app migration.
  • ⚠ merge, split and transform rewrite every row of their type. copy and backfill fill only values that are still empty. So a
    transform you deployed months ago also rewrites every row written since then. Read your migration files before your next deploy.
  • ⚠ A workflow that runs as its declared actor now acts for the person who started the run (the run row's [CreatedBy]), automatically.
    Every read and write is allowed only when both the actor and that person may. A run nobody is recorded as starting acts as the actor alone.
    A starter who has been switched off or removed counts as nobody: they have only the rights of a visitor who is not signed in. Adding
    [CreatedBy] to a run row therefore narrows that workflow's bodies to what the starter may do.
  • ⚠ In such a body, runas (<that actor>, onBehalfOf: p) now runs only when p is the person who started the run. Any other person is
    refused, and so is any onBehalfOf: when the run's row has no [CreatedBy]. Code that passed a person of its own choosing stops working.
    Declare [CreatedBy] Guid? StartedBy; on the run's row and write onBehalfOf: this.Item.StartedBy, or leave onBehalfOf: out, since the
    starter is already acted for.
  • ⚠ A kit's hidden or credential field read through your own entity that derives from the kit's entity no longer compiles. Before, a
    deploy accepted it; now it is refused as it is on the kit's own entity. An app that deployed such a read must change it before it can
    deploy again.

Security

  • A package's code runs only with its own capabilities, secrets and permissions, whatever namespace or path its files claim. Every server
    build checks each package archive; osy package check runs the same check offline. osy validate and osy publish in a package's folder
    refuse a package that grants the package it uses the computer, and warn (PACKAGE_GRANT_TO_DEPENDENCY_IGNORED) on any other grant to it.
    Such a grant never gave anything: the app grants.
  • A zone builds only the packages the control plane signed for a deploy; any other package a deploy names is refused by name before anything
    is compiled.
  • A zone builds a package archive for an organization only if that organization has itself uploaded it to that zone. A deploy that names an
    archive its organization never uploaded must carry it, or it is refused, naming the package. The platform's own packages are exempt.
    Each organization's first deploy after this release uploads its packages once more, so it is slower once.
  • An application file whose path contains :: is refused at compile (APP_PATH_HAS_CARRIER_SEPARATOR), so it can no longer be read as a
    package's file and take that package's permissions. A package archive that holds a file whose name contains :: is refused when it is
    installed or checked; osy package pack and osy publish refuse one before it is published, with the same message. osy validate now
    refuses an application file under Capabilities/ or Core/ the same way the server does (APP_PATH_UNDER_COMPOSED_FOLDER).
  • Inside runas (…, onBehalfOf: person), a switched-off person has only the rights of a visitor who is not signed in, and a call into another
    kit's function is still checked against that person's rights.
  • runas (Actor, onBehalfOf: X) now warns (ON_BEHALF_OF_NOT_ATTESTED) unless X is a person the platform itself recorded: the signed-in caller
    (Session.CurrentUser), a row's [CreatedBy] or [CreatedFor] stamp, Records.CreatedBy(row), null, or a local variable set from one of
    these and never changed. A later release refuses it.
  • A package no longer chooses whose rights a [JudgedFor] function's writes are checked against: [JudgedFor] must name the row's
    [CreatedBy] stamp. A kit's own build (osy validate, osy package pack, osy publish) refuses a [JudgedFor] that names anything else.
    An app that already uses a published kit release written the old way (Osysharp.Invitations 2.0.1) still builds: it gets the warning
    JUDGEDFOR_NOT_STAMPED, which names the kit, and that kit's rows are checked as before. Update the kit (Invitations 2.1.0) to clear the
    warning. This is planned to become an error in 0.20.0.
  • Links an app builds for itself (App.BaseUrl, a page's canonical address, a mailed link) no longer follow an address a visitor sends in a
    header: only a zone's own gateway can set it, and the gateway no longer passes on one a caller sent.
  • An application's own sign-in can no longer read traces: every /api/trace route refuses it. osy trace start --full, which records the
    values every run held, needs a developer of the application.
  • Every download of an app's data — a backup, or a restored copy as rows or a dump — is now recorded (who, when, which app and environment,
    what kind, how big) and shown to the organization's Owners and Admins under Data downloads.

Organisation policy

  • An organisation's outbound-host policy now also holds an app's osy test runs (including [AllowNetwork] tests), its embeddings (OpenAI,
    Gemini, or a BaseUrl it names), its sign-in and connected-account calls to OAuth/OIDC providers, and the images its pages load. A refused
    host fails with the organisation's policy message, and nothing is sent. When the platform cannot read the organisation's policy, nothing is
    sent either; before, it could be.
  • Under an organisation that allows only some hosts, an app's pages load images only from the app itself, inline images, the app's declared
    browser hosts and the allowed hosts. External images on other hosts no longer load there.
  • A sign-in through a provider the organisation does not allow is refused before the visitor is sent to it: "Signing in with X is not
    available: …". An app no longer fetches signing keys from, or accepts bearer tokens issued by, an identity provider its organisation refuses.
  • Organisation policy now holds the app settings it governs: saving a value that a lock or range forbids is refused, and so is a bulk update
    or insert that would write one. An app with no governed setting pays nothing for the check.
  • When the policy refuses a write of a governed setting, the REST API answers 403 with the policy's sentence, and MCP denies it with
    that sentence.
  • A generated settings page shows the policy's sentence when a save is refused, and puts back the edits the person may not make.
  • A deploy whose migration would write a value your organisation's policy forbids for a governed setting (for example a backfill outside a
    bounded range, a backfill that reads along a reference or counts over a collection into a locked setting, or a copy into a locked setting)
    is refused before anything is written, on every deploy path including zone builds.
  • A new compile warning, ORG_POLICY_WRITTEN_AT_COMMIT, says when a package's governed field is one the platform writes itself at save (a
    [Counter] or a row stamp): the policy can refuse that save, but cannot choose the value.
  • osy import under a policy: when one batch of rows is refused, the files after it are no longer refused for that batch's rows.
  • /policy/draft and /policy/revert now require basedOnNumber (the comingNumber read from /policy/draft-state); a call without it is
    refused with the number to send. A policy version can no longer be saved or approved with an in-force date in the past.
  • Admin's policy catalogue now says where a governed app setting is enforced. It also says what is not yet covered: values stored before a
    lock or range are not changed to fit it.

Fixes

  • A page part whose live data depends on its parent's data no longer stays on its loading placeholder when the parent's data changes while it
    loads.
  • Adopting existing rows into a workflow whose state arms a timer or offers work no longer fails with "Object reference not set to an instance
    of an object".
  • A workflow whose Tracks names a row type from another namespace (through using) now works. Before, every new row failed with "'State' is
    required", and X.Start(run) did not compile.
  • An app entity or class may share a name with a platform entity (such as Counter); before, creating one in a test or a server function failed
    with "entity … not found".
  • A [Client] function or a public page action may now call pure built-in members such as a regex match's Groups[...]; before, they were
    refused as running on the server.
  • allow read via F now reads the stored value of a row handed to F as an argument, and of a row of a subtype of the entity, so a kit can check
    a field it hides from everyone; a member a subtype adds and hides stays hidden from F. F reads the same inside runas (Actor) { … } as
    outside.
  • After Delete() and UnitOfWork.Commit() (or Discard()), a deleted row is no longer reported as an unsaved change.
  • Deleting a row and creating its replacement with the same [Unique] value before one save now saves as a replacement; a real duplicate
    is still refused.
  • A migration line the deploy cannot carry out is refused before anything is written (MIGRATION_DATA_VERB_REFUSED): a member that does not
    exist, values moved between entities stored in different tables, a copy between two types, a copy between references to different entities,
    or a lambda that cannot run in the database. A copy from a reference into a Guid member copies the id the reference holds. A backfill
    lambda can read one hop along a reference: r => r.Team.Lead.
  • A [Test(F)] whose fixture does not compile reports the fixture's own error, not "unknown fixture".
  • A function that calls a helper that did not compile now says so (CALLEE_DID_NOT_COMPILE: "it calls 'X', which did not compile"), after
    the helper's own error, instead of calling it a gap in the compiler.

Performance

  • A commit that creates many rows with Markdown members no longer asks the database anything per row: in our measurement, 400 rows took 11
    statements instead of about 10,900 and about 2 s instead of 15–26 s, and the cost now grows in step with the rows.

Platform and tools

  • osy validate and osy publish in a package's folder now say what the package reaches (outbound calls, secrets, browser code, scripts,
    the computer, native code), read from its own manifest and files; anything the reader does not recognise counts as reaching everything.
    The line only reports; it refuses nothing.
  • A package's entry in the package index now gives its use line with the grants its manifest asks for, for example in osy package search.
  • [CreatedFor] Guid? X; is a new row stamp: it records the person a row was made on behalf of. Inside runas (…, onBehalfOf: p) that is
    p; otherwise it is the signed-in caller. No code can write it. Records.CreatedBy(row) returns any row's stored [CreatedBy].
  • A Button's new busyLabel: "Saving…" shows your words in place of its label while its action works. A busy button is now marked
    aria-busy, and under reduced motion its spinner stands still.
  • The lint security-read-via-asks-about-one-row now also warns when a protected field of a row the function was handed or looked up is
    compared with a value from one of its parameters.
  • In osy test: a stub answering a click can call the real function, the test-only runas works inside such a stub, and Ui.HoldServer
    holds a page action's server call so that its busy state can be tested.

Admin

  • Slow actions show that they are working. A pressed button shows a spinner and its verb ("Deploying…", "Restoring…", "Approving…", "Saving…",
    "Making it available…"). A confirmation cannot be cancelled while its action runs, and after a second it says what is happening.
  • The organisation policy pages have a new look: the Policies, Versions and Approvals tabs open with a summary band. When two people approve
    at once, the Approvals tab shows the conflict.
  • Invitations sent before this release keep working: their sender is filled in from the invitation's inviter.
  • If a policy draft is open when this release is installed, approve or replace it before saving it again: until then, two people saving and
    approving it at once are not stopped.

Kits

  • New kit: Osysharp.Diff 1.0.0 shows a unified diff with changed-word highlights, unchanged runs folded (opened in place when you pass the
    whole old and new text) and a side-by-side view; all text is shown as plain text.
  • Agents 2.0.0 (see ⚠ above), with the agents family: Agents.Inspector and Agents.Management 3.0.0; Agents.HumanRequests, Agents.Processes,
    Agents.Teaching, Agents.Testing, Assignments.Agents, Privacy.Agents, Privacy.Agents.HumanRequests, Shop.Agents, WorkRepositories.Agents 2.0.0.
    An answer relayed from another request decides nothing, yes or no. Work tried again is for whoever the first work was for; work opened
    before 2.0.0, which records nobody, acts as the agent alone.
  • HumanRequests 1.6.0: each answer is recorded as a GivenAnswer made in the answerer's own request, and rolls up to its request.
  • Invitations 2.1.0: records who sent an invitation (SentBy) and checks what accepting it grants against that person's rights. If your
    app has pending invitations, add copy Osysharp.Invitations.Invitation.InvitedBy -> Osysharp.Invitations.Invitation.SentBy; to the
    migration of the same deploy that moves to 2.1.0.
  • Patch releases: Mail.Resend 0.2.1, Sms.FortySixElks 0.2.1 (they no longer write a grant for the package they use: it never took
    effect, and your app's grant is unchanged), Assignments.Allocations 1.3.1, Assignments.WorkQueues 1.3.1, HumanRequests.Processes 1.3.1.