# Osysharp.WorkRepositories — what an assignment knows, kept as items

> `Osysharp.WorkRepositories` keeps an assignment's evidence, correspondence, findings, documents and decisions as items. An item is never overwritten: a change is a version, and each version says who or what wrote it and what it was read from.

<!-- id: agent-kit-work-repositories · area: agent · stability: preview · html: https://osysharp.com/reference/agent/kit-work-repositories/ -->

> **You are here:** [Building with agents](https://osysharp.com/reference/agent/guide/) › [The kits](https://osysharp.com/reference/agent/guide-kits/) › WorkRepositories

## Summary        {#summary}
`Osysharp.WorkRepositories` keeps an assignment's evidence, correspondence, findings, documents and decisions as items. An item is never overwritten: a change is a version, and each version says who or what wrote it and what it was read from.

What kind of thing an item is, and where it stands — unverified, accepted, rejected, superseded — are two separate facts. Two items that contradict each other stay linked as a disagreement until a decision resolves it. One kind can be seen by fewer people and kept for less time.

|  |  |
|---|---|
| Package | `Osysharp.WorkRepositories`, version 1.1.0 |
| You add it with | `use Osysharp.WorkRepositories;` in the app's manifest. |
| It sits on | [[agent-kit-assignments\|Assignments]] |
| It also uses | `Identity`, `Storage`, `Ui` — parts of the platform's own library |
| Bridges that arrive when it meets another kit | [[agent-kit-privacy-work-repositories\|Privacy.WorkRepositories]], [[agent-kit-work-repositories-agents\|WorkRepositories.Agents]] |
| Its own test app | A company hiring a consultant — `kits/work-repositories/tests` |

## Description    {#description}

### What do you get without writing anything?   {#free}
- Every version of every item, with its author: a person, an agent's account, or the app.
- Two people who start from the same version both stay; the item says it has something to reconcile.
- A criterion met *with* an item: the evidence is one click away.
- The repository on the assignment's page.

### When do you need it?   {#when}
When work gathers things over time that somebody will have to rely on later.

### What does it expose?   {#exposes}
The tables below are generated from the kit itself, not written by hand: `osy kits Osysharp.WorkRepositories --surface` lists each of
them with the code of the kit's own test app that uses it, and the tests that show it working.

**Settings** — one line in the app, each field with a default.

| You write | It says |
|---|---|
| `app.WorkRepositories = new WorkRepositoriesSetup { Kinds, ItemPath }` | How this app keeps its assignments' repositories. |

**Policies you answer** — each is a question the kit asks your app: `policy Name => …;`

| Policy | The question | Until the app says otherwise |
|---|---|---|
| `ManagesWorkRepositories` | Who looks after the repositories: reads every item of every assignment, restricted ones included, and erases what has outlived its time — without being on any assignment. | the kit's own default |

**Functions you call**, those its own tests show most first.

| Function | What it does | Tests that show it |
|---|---|---|
| `OpenKindTo(Assignment a, ItemKind kind, Principal person)` | Open every item of one kind, on one assignment, to a person on it — the hiring manager reads the interview feedback; the other interviewers do not. | 25 |
| `CloseKindTo(Assignment a, ItemKind kind, Principal person)` | Close a kind to a person again. | 25 |
| `OpenItemTo(RepositoryItem item, Principal person)` | Open one item to one person — on the assignment or not. | 25 |
| `CloseItemTo(RepositoryItem item, Principal person)` | Close an item to a person again: their next read finds nothing. | 25 |
| `RestrictItem(RepositoryItem item, bool restricted)` | Make one item restricted, or open it to everybody on the assignment again. | 25 |
| `EraseItem(RepositoryItem item, string why)` | Erase an item: its content, its data and its file are gone from every version; the item and its history stay, to say that there was one, what kind, who added it and when. | 25 |
| `KeepItemUntil(RepositoryItem item, DateTime? until)` | Keep an item until `until` — or, with null, as long as its assignment. | 25 |
| `TakeContributorOffRepositories(Principal person, string why)` | Take a contributor off the repositories: everything `person` added, wrote, accepted or rejected, raised or settled stays — the items, their versions, their standing — and is no longer theirs: who… | 25 |
| `AddItem(Assignment a, NewItem what)` | Add an item to an assignment's repository. | 25 |
| `ReviseItem(RepositoryItem item, ItemRevision change, int basedOn)` | Change an item — which adds a version and overwrites nothing. | 25 |
| `ReconcileItem(RepositoryItem item, int keep, string why, ItemRevision? merged = …)` | Settle the contributions kept beside an item's standing version. | 25 |
| `Contributor()` | Whoever is signed in, or the actor whose block is running. | 25 |
| `ItemPath()` | Where this app shows one item: the path its id is put after, or "" when the app has not said. | 25 |
| `NoteDisagreement(RepositoryItem first, RepositoryItem second, string about)` | Record that two items do not agree. | 25 |
| `ResolveDisagreement(RepositoryDisagreement disagreement, RepositoryItem decision, string how)` | Settle a disagreement with a decision — an item of kind `Decision`, written by somebody in charge of the assignment. | 25 |
| `CurrentOf(RepositoryItem item)` | The version of an item that stands. | 21 |
| `ItemsOf(Assignment a, ItemKind? kind = …)` | The items of an assignment's repository, oldest first — of one kind, or of every kind. | 11 |
| `VersionsOf(RepositoryItem item)` | Every version of an item, oldest first. | 8 |
| `AcceptItem(RepositoryItem item, string why = …)` | Take an item as right. | 6 |
| `RejectItem(RepositoryItem item, string why)` | Take an item as wrong. | 4 |
| `ItemSheetOf(Guid item)` | One item, with every version, as whoever asks may read it. | 4 |
| `ItemOf(Assignment a, string key)` | The item of `a` called `key`, or null. | 3 |
| `OpenDisagreements(Assignment a)` | The disagreements of an assignment that nobody has settled. | 3 |
| `ExpiredItems()` | The items that have outlived the time their kind is kept, and are still there. | 1 |
| `EraseExpiredItems()` | Erase everything that has outlived its time, and answer how many items that was. | 1 |
| `SupersedeItem(RepositoryItem item, RepositoryItem by, string why = …)` | Another item takes this one's place: a newer statement, a corrected document. | 1 |
| `MeetWith(AssignmentCriterion criterion, RepositoryItem item, string metBy)` | Meet a criterion with an item: the criterion says what met it in words, and points at the item as what that rests on. | 1 |

**Screens and components you mount** — each is one line in a page of yours.

| Component | What it draws |
|---|---|
| `RepositoryList(assignment, open)` | The repository of an assignment — its items, each with what kind of thing it is, where it stands, who or what added it, and whether a contribution waits beside it; and the disagreements nobody has settled. |
| `RepositoryOnTheAssignment(assignment)` | The repository, on every assignment's page. |
| `RepositoryItemRow(i, href)` | One item in a list. |
| `RepositoryItemView(item)` | One item on a page of its own — what it says now, where it stands and why, where it came from, and every version it has had, with the contributions that wait beside the one that stands. |
| `VersionCard(v, canKeep, onKeep)` | One version: what it says, who or what wrote it and from what, and whether it stands or waits beside the one that does. |

**Events your app can hear** — `[On] void Heard(EventName e) { … }`

| Event | When |
|---|---|
| `RepositoryItemAdded` | An item was added to an assignment's repository. |
| `RepositoryItemContested` | A contribution was kept beside the version that stands: somebody has two versions to reconcile. |
| `RepositoryItemAccepted` | An item was taken as right by somebody in charge. |
| `RepositoryItemRejected` | An item was taken as wrong by somebody in charge. |
| `RepositoryDisagreementRaised` | Two items were recorded as not agreeing. |
| `RepositoryItemErased` | An item's content was erased. |

**Records your app grants access to** — the kit writes them; `partial entity X { security { … } }` says who else reads them.

| Record | What it is |
|---|---|
| `RepositoryItem` | One thing an assignment knows: a piece of evidence, a letter, a finding, a document, a decision. |
| `RepositoryItemVersion` | One version of an item: its content as one contributor wrote it, who or what that was, when, and what it was read from. |
| `RepositoryShare` | Something of a repository opened to one person: every item of one restricted kind (`Item` is null), or one item by itself (`Item` is set) — which is how a helper that is not on the assignment is … |
| `RepositoryDisagreement` | Two items that do not agree — a finding and the evidence against it, two specialists' conclusions. |

## What to read next   {#read-next}
- [Osysharp.WorkRepositories.Agents — what an agent finds, kept as items and not as lines of a log](https://osysharp.com/reference/agent/kit-work-repositories-agents/) — what an agent finds, kept as items and not as lines of a log
- [Osysharp.Assignments — a piece of work somebody asked for, owned until its outcome is reached](https://osysharp.com/reference/agent/kit-assignments/) — a piece of work somebody asked for, owned until its outcome is reached
- [A parcel that never came — a case owned until it is right, closed, and opened again](https://osysharp.com/reference/agent/story-delivery/) — a parcel that never came — a case owned until it is right, closed, and opened again

## Go deeper   {#see-also}
- [Work repositories — what an assignment knows, kept as items (WorkRepositories kit)](https://osysharp.com/reference/agent/work-repositories/) — versions, standing, disagreements, access, retention
