Providing files, and giving them back

Brigitte Bigi

User manual

Not written yet. This chapter is the help of the person who sends files and gets back what was produced: what the two containers show, and what is done on them. This service has no page of its own: what is described here is what an app places in its own.

Developer manual

This chapter is for whoever reads or changes the code. What the code is for, and why it is cut this way, is the chapter on the modelling; what follows is what a developer has to know to use it, and what is refused to him.

How the code is organised

In sppas/ui/swapp/services/files/, one module per kind of knowledge, named files_<name>.py. Each class carries the radical of the package.

ModuleClassWhat it is alone in knowing
files_feedingswappDataFeeding, swappDataFilesWhat a name, a size and a content are, and what a volume is made of
files_acceptanceswappDepositAcceptanceWhat SPPAS reads, and how a refusal is said
files_placeswappFilePlaceThe deposit API. The only one which calls it
files_chooserswappFileChooserThe file chooser of SPPAS. The only one which opens a dialog
files_workspaceswappWorkspaceFilesThe domain of the workspaces. The only one which speaks to it
files_handingswappAppExchangeWhat is given to an app, and what is read of what comes back
files_deliveryswappResultDeliveryThe address of a produced file
files_provisionswappFileProvisionThe order of the tasks of one request
files_recordswappFilesRecordWhat one request carries, and how it travels
files_viewswappDepositViewThe HTML. The only ones which build a node
files_controllerswappFilesControllerThe names of the tasks
files_managerswappFilesManagerNothing: it builds the others and hands them over

The third column is what says where a change goes. The day the deposit API changes, one file is read again; the day the workspaces change, another one; the day the page changes, a third. A module which knew two of those things would be read again for both.

What an app has to do

An app holds one object of this service, swappFilesManager, and nothing else of it is ever named outside.

  1. Build it, with the identifier of the node it will append the container to — the identifier, and not the node: a node of WhakerPy carries the identifier of its parent, and one built under another is refused. It takes as well the workspace it works on, when the app holds one.
  2. Offer it what was not recognised: consumes(events) answers true when the request was of this service, false when it was not. Nothing is changed in that second case.
  3. Ask whether the person has said the workspace is ready: is_ready(), after consumes(). When it is, ask for the files: files_for_app().
  4. Have it build: populate_view(), then container(), which is appended where the app chose. In that order: the container is what the last request made. The container carries no title: the app writes its own, at the level its page calls for, and the container names itself for whoever reads the page without seeing it.
  5. Ask for the files when the app is about to work: files_for_app(). And give back what was produced: produced(workspace), which answers where each produced file is reached — where it stands, or at an address — and until when: the app shows them, this service shows nothing of them.
  6. Say what it is holding: lock(names) when it takes files to work on them, release(names) when it has done with them. What it still holds when it says it has finished is released without it asking. A lock is what keeps the other interface from taking a file being treated, so an app which does not say it is holding one is an app which lets that happen.
  7. Start over when the person asks for it: start_over(). The container shows the deposit again, and the files are known to a new workspace, holding none.

The events are handed over whole. An app which filtered them would take away the hidden fields the page carries back, and the person would see her list vanish without having touched it.

Three things an app never does, and they are the promises of this service: it does not hold the workspace of the person — what it receives is made for it, and what it damages is its own; it does not write in that workspace, this service doing it on the word of the app; and it does not build the markup of the container, or a test would pass where the app fails.

The events it consumes

One name and one value, in the dictionary a request carries. Six names are answered, under the key task, and no other:

TaskWhat comes with itWhat it does
designatepath, where the files stand already; name and size where they have to be broughtMakes the file known and checked, or takes it into what is to be sent
take_backnameTakes the file out of the workspace, or out of what is to be sent
sendcontents, the bytes by nameAsks for a place, writes the copies, makes them known and checked
ready—Says the workspace is ready (E7): nothing is sent, nothing is asked of the deposit API
produced—Marks as treated the files an app treated
finished—Releases what an app still held

The record comes back in those same events, as the hidden fields the view wrote: the task, the workspace, and what was fed. A request which carries none of the six names is a first request, whatever else it carries.

The stylesheets

The views write no style of their own and no string of their own: they name classes, and what renders them is the page the container stands in.

What they name, and nothing else: dropzone, dropzone-name, dropzone-size, file-status with file-status-ok and file-status-error, the cards-panel and the card, card-body and card-footer of Whakerexa, cta-button, and the aria-invalid attribute on the card of a file which was refused.

Nothing is said here of what renders them.

The tests

In tests/swapp/test_files.py, numbered as the chapter on the tests numbers them. Fifteen of them need nothing installed: what is accepted, what is counted, the view, and the door. The others need a disk, the deposit API, or the domain of the workspaces.

The one to keep first is TE15: everything in what was handed to an app is changed, emptied and added to, and the workspace of the person has not moved. Every other promise of this service rests on it.

Modelling

Problem and scope

Description

The apps of swapp process files. They do not choose them: the files come from the working context of the person, not from the tool she happens to be using. What carries them is a workspace, and a workspace does not fill itself.

The person has her files where she works. SPPAS runs where it is installed, which is her own machine or a server, and the two are not always the same one. Everything to be settled follows from that gap: how a file she holds gets to where an app reads it, how she says which ones are to be treated, and how what an app produced comes back to her.

An app asks for what it needs and treats what it receives, and it says for itself whether what it received is enough. What it asks for, and what the person sends, is the whole of the question.

Defining the needs

The needs are those of the person. They name no technique: the means of satisfying them belong to the levels below.

  • B1 — To have an app work on the checked files of the workspace, without checking them again in every app.
  • B2 — To send files to SPPAS, and to check among them those an app is to treat.
  • B5 — To have SPPAS read the files she sends it, whether or not it runs on her machine.
  • B6 — To know that nothing of what was sent is kept.
  • B7 — To know what quantity of files SPPAS accepts.
  • B8 — To know what size of file SPPAS accepts.
  • B9 — To find what an app produced among her own files, ready for the next thing she does with them.
  • B11 — To know which files SPPAS accepts.
  • B12 — To get back the files which were produced, or where they are, one by one or all at once.
  • B13 — To see which files were grouped together, and what they produced.
  • B14 — To correct what one has fed, before sending it.
  • B15 — To know where one stands against what is accepted, while feeding.
  • B16 — To know what became of each file she sent, and why, when an app made nothing of it.
  • B17 — To see, on each file she gave, where it stands: added, deposited, refused, treated, or no longer reachable.

One machine of the first situation behaves as one of the second: designating a file where it stands opens a window of the computer, and a computer without that window cannot be asked. The person then deposits her files, exactly as she would on a web service, and the page says why. It is not a third case: it is the second one, reached for another reason. B5 is the need which holds the two situations together without naming either: where SPPAS runs on the machine of the person the file is already there and there is nothing to do; where it does not, the file has to get there — and the place it gets to is asked of a neighbour, which is all this domain knows of it.

B9 and B12 are two moments of one thing. This domain serves B9: what an app produced is added to the files which are known and checked among them, by this domain and never by the app, so that the next treatment finds it already designated. It serves B12 without showing anything of it: it makes what was produced reachable by the person wherever she reads it, and gives the app the address of each produced file and until when it can be reached there. The app shows them, beside what became of each file (B16): what was produced is the result of the app, and it is read where its results are.

B17 is what this domain shows from the first file she gives: not what was produced, but where each file she gave stands. Locally a file is deposited, then treated; online it is added, then deposited or refused once it was sent, then treated, and no longer reachable once its time is over. A file which was treated can be neither taken back nor handed again. The difference between added and deposited is what the person acts on: what is added may still be taken back and is what sending sends, what is deposited has travelled and is what an app is given. A deposit holding nothing added has nothing to send, and the control which sends says so by not answering.

Scope

This document covers the provision of files to an app, and the return to the person of the files an app produced: where the files come from, what is handed over, when, and how what was produced is reached — this domain makes it reachable and gives its address to the app, which shows it.

The two directions are one design and not two. A file is in place and the workspace says where it is, or it has to travel and it stands in a place a neighbour gave, bounded and perishable, which the person reaches at an address. An app says what it has produced and says when it has finished, and what this domain gives back holds to those two.

What is not covered: the workspaces, whose functioning is established and which belong to their own domain; the place where a file stands when it had to travel — what names it, how long it lasts, who may reach it — which is an API of its own with a dossier of its own; and what an app does with the files it receives, and whether they suffice it.

Conceptual level

Data dictionary

Six things are handled, and they are all that is handled. The person and the apps are not among them: they are actors, and they belong to the model of communication. The words are those of the SPPAS code, and no others — save one, which the code does not carry yet, and which is said where it stands.

  • D1. The file — an object stored on a machine, identified by its name where it stands. A workspace retains its name, not its content: the content is read at the moment of the treatment. What is manipulated here is its name and its size.
  • D2. The state — one single value, carried by every file of a workspace and taken from States(): MISSING, UNUSED, CHECKED or LOCKED, and these four only.
  • D3. Checked — the CHECKED value of the state. It alone says that a file is to be treated.
  • D4. The workspace — the set of the files which are known, held on three levels — the path, the root, the file — each one carrying its state, together with the references. It is what carries the set to be treated, and what is handed to an app is made from it. One is active at a time.
  • D5. The copy — a duplicate of a file, made where the app works, because the original is not there. It is a file in the sense of D1, and it stands in a place the deposit API gave: bounded and perishable, on that domain's terms and not on ours. A file an app produced is not a copy: it is an original, and it perishes because it stands there too.
  • D6. The deposit — the copies sent at one time. It exists while it is fed, and it knows the place the deposit API gave it once it is sent. It is what a total volume is counted on, and what tells two copies of one name apart. This is the word the code does not carry yet.

Conceptual model of communication

The domain studied does two things: it gives an app the files it is to treat, and it gives the person back what that app produced. Nothing else. Four actors border it, two of which are neighbours it calls. The interfaces through which the person acts are not actors: they are what this document designs — the one where she feeds what she sends, and the one where she reaches what was made.

Actors

  • A1. The person — she sends her files, says which of them are to be treated, asks for an app, and gets back what was produced.
  • A2. An app — it asks for what it needs in order to work, judges whether what it received suffices it, and produces files.
  • A3. The domain of the workspaces — the neighbouring system which holds the files that are known and their states.
  • A4. The deposit API — an API, and no face: it gives a bounded and perishable place where a file may stand when it is not on the machine of the person, says what it accepts, gives an address at which one of them is reached, and forgets what is out of date without being asked.

Flows

  • F1. A1 → domain — her files, and which of them are to be treated (B2, B5).
  • F2. A2 → domain — the request for the files it is to treat (B1).
  • F3. domain → A1 — what is accepted, before anything is sent, and that nothing is kept (B6, B7, B8, B11).
  • F4. domain → A3 — the files to be known, their checking, and the states this domain sets on them (B2).
  • F5. A3 → domain — the workspace and the states of its files (B1).
  • F6. domain → A2 — a workspace holding the files to be treated, and them only (B1).
  • F7. A2 → domain — what it has produced, in the workspace it was given, as often as it has something to give back (B12).
  • F8. A2 → domain — the treatment is over.
  • F9. domain → A3 — the files produced, added and checked (B9).
  • F10. domain → A2 — where each produced file is reached, where it stands or at an address, until when, and what was grouped with what: the app shows them (B12, B13).
  • F11. domain → A1 — what was not taken in, and why; and where she stands against what is accepted (B14, B15).
  • F12. domain → A4 — the request for a place, the files to put there, and the request for an address.
  • F13. A4 → domain — what it accepts, the place it gives or its refusal with when to come back, and the address at which a file is reached.
  • F14. A2 → domain — the request for files, when what it received does not suffice it.
  • F15. domain → A1 — where each file she gave stands: added, deposited, refused, treated, or no longer reachable (B17).

It is the domain which writes into the workspace — what it was given to make known, and what an app produced, on the word of that app (F7, F9). The app never writes there itself, for it never holds it. RO9

The deposit API has no face, and that is what makes the two interfaces this domain's. A place knows neither workspace, nor root, nor app: it holds bytes and forgets them. What the person is shown — what may be sent, what was refused and why, which produced file goes with which sent one — is knowledge of this domain, so the containers where she reads it are of this domain too.

Conceptual model of data

Four classes. The workspace is one of them without being modelled here: its functioning is established, and it belongs to the domain of the workspaces. It appears with its identifier and no property. What it holds — the three levels, the states, the references — is read where it is written, and this document adds nothing to it.

The classes of entities

ClassPropertiesWhat it is
FILE # machine, # name, size A file in place, where it is (D1). A file an app produced is one of them: it stands beside the file it was made from, under the same root, and it perishes with the deposit which holds them both when that deposit is what it stands in
COPY # deposit, # name, size A duplicate made where the app works, because the original is not there (D5). It exists only inside its deposit, and is identified relatively to it
DEPOSIT # deposit, place The copies sent at one time. It exists while it is fed, and it holds the place the deposit API gave it once it is sent
WORKSPACE # workspace The files which are known and their states (D4). One is active at a time, and it is the only one this domain sees

A copy is in its deposit from the moment the file is taken in, and before the deposit is sent it carries a name and a size and no content: that is what the verifications of T08 are made on. Such a copy is said added: the person designated the file, nothing of it has travelled, and she may still take it back. A copy becomes deposited when the deposit it belongs to was sent and the place answered for it.

The relations

No.VerbLeg 1Leg 2
R1belongs toCOPY (1,1)DEPOSIT (1,n)
R3is known toFILE (0,1)WORKSPACE (0,n)
R4is added toDEPOSIT (1,1)WORKSPACE (0,1)

R1 is an aggregation: a copy is named inside the deposit which carries it, and two deposits name a copy the same way without naming the same copy. It is also what identifies a copy — its name inside its deposit — the first rule below making sure that two of them never share one.

A copy is known to a workspace as well, and that is not a relation: it follows from R1 then R4, a copy being known to the workspace its deposit was added to. Written as a relation it would repeat what the keys already say.

R4 is the case where the files have to be brought, and nothing else. Where they are already reachable nothing is added to a workspace, whether it pre-existed or T02 made it; where they are brought, a deposit is added to the workspace T02 makes, with the names of the copies. One deposit and one only: a deposit carries the moment it was made at, so a second deposit is another deposit, standing elsewhere, and the workspace which takes the name of what holds the copies is another workspace.

FILE and COPY carry the same verb towards the workspace, and that is what is not written here: a copy is a file which perishes, D5 saying so in as many words, and the two ought to be one class and its specialisation. They are written as two classes for want of it.

Computed, and never held

  • The volume of a deposit, which is the sum of the sizes of its copies, and which is compared to what the deposit API accepts (C4).
  • That a file is reachable: it is, when it is in place, or when it is a copy (T01).
  • The address at which a produced file is reached, which follows from the file and lives as long as it does (T05).
  • What is handed to an app, which is made from the workspace when an app asks and is never kept (T03).

What the keys do not hold

  • Two copies of one deposit never bear the same name: a file whose name is already taken is not deposited, and what was refused is said (F10). C12
  • A copy bears the name of the file it duplicates: a deposit renames nothing, the workspace being made with the names which were deposited.
  • The copies of one deposit stay within what the deposit API accepts, which that domain says and this one relays (C4).
  • Only a deposit is added to a workspace: what is delivered to the person is added to none.

What is not modelled, and why

  • The state and checked (D2, D3), which the workspace carries at its three levels. This domain asks for the checking (T02) and reads it (T03); it does not hold it.
  • The bounds and the duration, which belong to the deposit API; and the extensions, which are SPPAS's (C4).
  • What names a place and what authorises reaching it, which are the deposit API's and are never read here.
  • What was not deposited, and why (F10): said to the person, and not kept (B6).
  • The apps, which are actors (A2): an app asks this domain for what it needs and treats what it receives, so nothing of them is held here.

Conceptual model of treatments

Eleven treatments, and they are all that the domain does. They say what is done, on what, and on which event — not when, not where, not by whom, which belongs to the organisational level. Nothing here says which case one is in: the conceptual model is the same in all of them, and that is what makes them one design and not three.

The chain runs thus: an app asks, and either it receives the workspace or there is none and files are asked for; the person is told what she may send, she composes what she sends and sends it, the files are made reachable and made known, and the app is answered. When it has finished, what it produced is made known and made reachable by the person. What was made only to be handed over does not last, and it is the deposit API which sees to that.

The events

No.EventKindComes from
E1An app asks for the files it is to treatexternalAn app (A2)
E2An app asks for filesexternalAn app (A2)
E3The person sends what she has composed, and says which of them are to be treatedexternalF1
E4An app gives back what it has producedexternalF8
E5There is no workspaceinternalT03
E6The files sent are reachableinternalT01
E7The workspace is readyinternalT02
E8Files have been producedinternalT04
E10The person designates a file, to be sentexternalF1
E11The person takes back a file she designatedexternalF1
E12An app takes a file it was given, to work on itexternalAn app (A2)
E13An app gives a file backexternalAn app (A2)
E14An app has finished treatingexternalF12

Deleting what is out of date is no treatment of this domain, and no event of it either: the deposit API empties itself, nobody asking it to. What this domain has to know is that a place does not last.

T01 — Make a file reachable

Purpose: that a file sent by the person exists where an app will read it.

WhatSays
SynchronisationE3
ActionsMake reachable, where an app will read it, every file of what is sent which is not; verify its type on its bytes
ResultOne copy for every file which was not reachable. When its type is accepted
ResultWhat was not deposited, and why (F10). When a type is refused
ResultE6, the files sent are reachable. When at least one of them is
ResultThat nothing can be deposited now, and when to come back (F10). When the deposit API refuses a place — and nothing of what was sent is deposited

What is verified here is what needs the content: the type of a file, read on its bytes and not on its name, an executable or a script not being deposited. The name, the size and the volume were verified when the file was taken in, on what was known of it before anything travelled. T08

T02 — Make the files known, and check those to be treated

Purpose: that the workspace knows the files, and that those to be treated are checked in it.

WhatSays
SynchronisationE6
ActionsMake a workspace when none exists; make it know the files which are reachable; check those the person said are to be treated
ResultThe files to be known, and their checking (F4). Always
ResultE7, the workspace is ready. Always

It examines no content.

Making a workspace when none exists belongs here and nowhere else. A deposit does not make one: it makes files reachable, which is another thing, and there are files to be made known which never went through a deposit — those a person picks on the disk of the machine where SPPAS runs, when nothing is installed to manage workspaces for her. Tying the making to the deposit would leave that case with no workspace at all, and it is the case of whoever has only a browser.

T03 — Hand to an app the files it is to treat

Purpose: to give an app what it needs in order to work.

WhatSays
SynchronisationE1 OR E7
ActionsRead the workspace; make a workspace holding the files to be treated and them only; hand it to the app which asked
ResultA workspace holding the files to be treated (F6). When a workspace exists
ResultE5, there is no workspace. When none exists

What is handed is a workspace made for the app, holding the files to be treated and nothing else — possibly nothing at all. The one the person composed stays where it is: an app never holds it, so it cannot touch what it was not given, and « an app does not check the files it treats » stops being a rule to respect and becomes a thing it cannot do. RO9

What is handed may hold nothing. An app reads what may be empty and says itself what it needs: the domain cannot say it in its place, knowing neither how many files an app wants nor of which kind.

T04 — Add the produced files to the workspace

Purpose: that the files produced by an app are known to the workspace and checked.

WhatSays
SynchronisationE4
ActionsTake from what the app gives back the files it produced, write them into the workspace with the grouping they carry, and check them; take as well, for a file it made nothing of, the cause it states
ResultThe files produced, added and checked (F7). Always
ResultE8, files have been produced. When the app produced any

Adding them does not uncheck what was treated. The app never wrote in the workspace of the person: it never held it. RO9

The cause is the app's, and the app shows it. Why an app made nothing of a file is the app's to say: it alone knows what it needed and what it found in that file. It says it beside that file, among its results; this domain carries no such sentence and writes none of its own. B16

An app gives back as often as it has something to give back, and nothing obliges it to wait until it has finished: a design which forbade that would forbid what no need asks to forbid, and the person would wait for her first result until the last one was made.

The app gives back the workspace it was given, enriched with what it produced. Grouping files — a path, a root, a name — is the workspace's own work, and the domain does not redo it in its place: it takes what came back and writes it where it belongs. It is also what lets the app show which files were grouped together and what they produced (F10).

T05 — Make the produced files reachable by the person

Purpose: that the person gets back what was produced without knowing where it was written.

WhatSays
SynchronisationE8
ActionsMake every produced file reachable by the person, where an app wrote it: beside the file it was made from
ResultWhere every produced file stands, given to the app (F10). When the person reaches it there
ResultAn address at which every produced file is reached, and until when, given to the app (F10). When she cannot reach it where it is

What is handed over is an address and not a file: the copy the person ends up with is made by what fetches it, and this domain knows nothing of it, which is what B6 asks. The address lives as long as the file it names. Where she cannot reach them, every produced file is also gathered in one archive, and the address of that archive is given with the others: a batch of ten files is got back in one gesture and not in ten. The archive is written where the produced files stand, so it is one file of the deposit like any other — it is reached by an address of the same kind, it perishes with the deposit which holds it, and nothing of it outlives the duration. Where she reaches the files where they stand, no archive is made: there is nothing to fetch.

T07 — Announce what is accepted

Purpose: that the person knows what she may send, before she sends.

WhatSays
SynchronisationE2 OR E5
ActionsSay the bounds, the extensions which are accepted, and that nothing of what is sent is kept
ResultThe announcement (F3). Always
ResultThat nothing can be deposited now, and when to come back (F3). When the deposit API says it has no place

The announcement precedes any deposit, and it depends on no file.

Neither the bounds nor the hour to come back are decided here: they are asked of the deposit API and said as they were given. What is of this domain is that the person is told before she sends, and not after.

T08 — Take a file into what is to be sent

Purpose: that what the person is about to send is known to be acceptable before anything travels.

WhatSays
SynchronisationE10
ActionsRead the name and the size of the file designated; verify that the name is not already taken, that the size does not exceed what the machine accepts, and that the volume of what is to be sent stays within its bound; take it in
ResultThe file is in what is to be sent, and the volume it now makes. When the three verifications pass
ResultWhat was not taken in, and why (F10). When one of them fails

Nothing of the content is read here. A name and a size are known before anything travels, and they are enough for these three verifications; what needs the content is T01's. It is also why the person is told at the moment she adds a file, and not once everything has travelled.

What came with a refused file may fall in the root of the one which stays, and nothing shows it: the domain cannot tell them apart, the folder the person took them from not travelling with them. What groups the files is read in the results of the app, where the associations are seen.

T09 — Take a file back

Purpose: that the person can correct what she gave, before it is treated.

WhatSays
SynchronisationE11
ActionsTake it out of what is to be sent; where it was deposited, erase the copy too
ResultWhat is to be sent, without it, and the volume it now makes. Always

A file which is added has not travelled, so taking it back undoes the taking in and nothing more. A file which is deposited has travelled, and taking it back erases the copy which was made of it: what she takes back is gone from the place as it is gone from the list, and giving the same file again gives it added, as the first time. RO8

One file cannot be taken back: the one an app treated. It is the only refusal of this treatment, and the control which takes back says it by not answering on that card. Nothing else is forbidden here: a person who corrects what she gave does it one file at a time, and never has to take everything back in order to change one.

T10 — Lock a file for the app which takes it

Purpose: that a file an app is working on is known to be in use, and is not given to another.

WhatSays
SynchronisationE12
ActionsPass the file from checked to locked, in the workspace
ResultThe file is locked (F4). Always

Nothing more is needed to keep a file from being given twice. A state has one single value (D2), so a locked file is no longer a checked one, and what is handed to an app holds the files to be treated — that is, the checked ones. The exclusion is in the state, not in a rule.

An app takes and gives back as it works: one file at a time for whoever reads a content and produces a result, a file held for as long as it is open for whoever edits one. The domain does not choose between the two; it marks what the app says it is doing.

T11 — Give a file back

Purpose: that a file an app has done with is available again.

WhatSays
SynchronisationE13
ActionsPass the file from locked to checked, in the workspace
ResultThe file is free (F4). Always

A file given back one by one is what an app does as it works. What it still holds when it has finished is released by T12.

T12 — Release what an app still holds

Purpose: that nothing stays locked for an app which has finished.

WhatSays
SynchronisationE14
ActionsRelease every file the app still holds
ResultThose files are free (F4). Always

An app which gave everything back one by one leaves nothing to release, and this treatment does nothing. It is what makes an app which stops halfway harmless all the same, as far as the locks go.

Organisational level

Organisational model of treatments

One procedure per treatment, numbered as it is, and each one triggered by one event. What decides which procedures have anything to do is not where the software happens to be installed, but two questions, and they are independent: are the files already reachable, and does a workspace exist.

That makes three cases and not two. The files are in place and a workspace is there; the files are in place and there is none; the files are not in place. The fourth — files to be brought, and a workspace already there — is not a case: a deposit carries its own moment, so it stands in a folder of its own and makes a workspace of its own, and it behaves as the third.

The first two cases share every operator: what separates them is that a workspace has to be made, which T02 does when it finds none. They are one table. The third is the other.

When the files are already reachable

PFWhat it doesTriggered byIn chargeWhereWhenNature
PF1 (T01)Makes a file reachableE3——nevernone
PF2 (T02)Makes the files known, and checks those to be treatedE6the short path, or what manages the workspacesthe machine where SPPAS runs, which is herswhen the person asksconversational
PF3 (T03)Hands to an app the files it is to treatE1 or E7the domainthe same machineat every request of an appautomated
PF4 (T04)Writes the produced files into the workspaceE4the domain, on the word of the appthe same machineeach time an app gives something backautomated
PF5 (T05)Makes the produced files reachable by the personE8——nevernone
PF7 (T07)Announces what is acceptedE2 or E5——nevernone
PF8 (T08)Takes a file into what is to be sentE10the short path, or what manages the workspacesthe same machinewhen the person designates a fileconversational
PF9 (T09)Takes a file back outE11the samethe same machinewhen the person takes one backconversational
PF10 (T10)Locks a file for the app which takes itE12the domain, on the word of the appthe same machineeach time an app takes a fileautomated
PF11 (T11)Gives a file backE13the domain, on the word of the appthe same machineeach time an app gives one backautomated
PF12 (T12)Releases what an app still holdsE14the domain, on the word of the appthe same machinewhen an app has finishedautomated
PF13Gives back to whoever holds the workspace what was worked onE14the domain, on the word of the appthe same machinewhen an app has finishedautomated

PF1 has nothing to do because a file the person points at is already where SPPAS reads it; PF5 because the workspace says where the produced files are; PF7 because the announcement exists only where there is a refusal, and nothing is refused here. Three procedures, two modules.

When there is no workspace, the only difference is in PF2, which makes one. That is the case of a person who has on her machine a browser and nothing else, and it is served by the short path alone.

When the files are not reachable

PFWhat it doesTriggered byIn chargeWhereWhenNature
PF1 (T01)Makes a file reachableE3the interface of deposit, and the serverthe serverwhen the person givesautomated
PF2 (T02)Makes the files known, and checks those to be treatedE6the serverthe serveras soon as PF1 is doneautomated
PF3 (T03)Hands to an app the files it is to treatE1 or E7the domainthe serverat every request of an appautomated
PF4 (T04)Writes the produced files into the workspaceE4the domain, on the word of the appthe servereach time an app gives something backautomated
PF5 (T05)Makes the produced files reachable by the personE8the interface of deliverythe server, then the machine of the personeach time files have been produced, then when she follows an addressautomated, then conversational
PF7 (T07)Announces what is acceptedE2 or E5the interface of depositthe machine of the personbefore she gives anythingautomated
PF8 (T08)Takes a file into what is to be sentE10the domain, on the request of the personthe browser of the person, then the serverwhen the person designates a fileconversational
PF9 (T09)Takes a file back outE11the domain, on the request of the personthe browser of the person, then the serverwhen she takes one backconversational
PF10 (T10)Locks a file for the app which takes itE12the domain, on the word of the appthe servereach time an app takes a fileautomated
PF11 (T11)Gives a file backE13the domain, on the word of the appthe servereach time an app gives one backautomated
PF12 (T12)Releases what an app still holdsE14the domain, on the word of the appthe serverwhen an app has finishedautomated
PF13Gives back to whoever holds the workspace what was worked onE14——nevernone

What the two tables say

PF3, PF4, PF10, PF11 and PF12 are the same procedure in both, word for word: everything an app asks of this domain is indifferent to where the files came from. PF2 is the same work with two operators and two natures. What differs is the whole of what a deposit brings with it.

PF8 and PF9 are the only procedures which stand in two places. What the person handles is in her browser — the button, the file, its name and its size — and what decides is on the server, SPPAS being alone in knowing what it reads. What travels to be verified is a name and a size; the content stays where it is until she sends. RO8

The resources differ for one procedure only, PF1: where files have to be brought it works on the contents which travelled and on the bounds; where they are in place there is nothing to bring.

Giving the workspace back

One thing only writes the workspace, and what works on it otherwise works on a copy until it has finished. What one request carries is that copy: it is made when the copy is asked for, it is carried from one request to the next, and nothing of it is written where the workspace is held. An announcement of whoever holds it, made while a person is composing, does not touch it — which is what makes the two of them harmless to each other.

So a copy is given back, and PF13 is that procedure. It is triggered by E14, the app having finished, and it reports on the workspace which is held what an app is allowed to do to a copy: add a file, check one, uncheck one. Nothing else is reported. What an app did which it may not do — take a file out, set a state this domain does not set — stays in the copy and reaches nothing: a copy is where the damage an app does stops, and reporting it would undo that. F4 and F9 say the reporting at the conceptual level, and say it of no moment in particular.

Once, and at the end. A copy given back at every request would put two states against each other at every gesture of the person, and one given back before the app has finished is no longer a copy: what is given back is what was worked on, whole, when there is nothing left to work on.

It has an object in one case out of the three, and that is why it is empty in the second table. Where the files had to be brought, nothing on the machine holds a workspace: what one request carries is the whole of it, which B6 asks, and there is nobody to report to. Where they were in place and a workspace is held, that workspace is what is reported on. Where they were in place and none was held, T02 made one, and what was made is carried by the request like the rest.

What is worked on is one thing in the three cases all the same. The copy a request carries is the same object, made the same way, wherever the files came from — so there is one thing to write and not three, and PF13 is the one procedure which looks at where it is: it asks whether a workspace is held, and does nothing when none is.

No treatment of the conceptual level carries it. F4 and F9 are flows of that level and this procedure realises them, but the rule above — one procedure per treatment, numbered as it is — is not held by PF13, which is numbered alone. Either a treatment is to be named for it, or that rule admits a procedure which is a moment rather than a treatment.

The lock, and who sees it

PF10 and PF11 set the state on the copy and on the workspace which is held, at once. A lock is of use to whoever does not hold it: one which stayed in the copy would be seen by nobody, and the other interface could take a file an app is treating. It is the one state which does not wait for PF13, and the reason is in what a lock is for.

It is also the one state PF13 never reports, and the two say the same thing: a lock is posted while the work goes on, and when the work is over T12 has already lifted it. What is reported at the end is what an app added, checked and unchecked — never what it was holding.

Only a file the workspace which is held knows already is set: a file it does not know stands in a copy alone, nothing can take it there, and a state is no reason to make it known.

A lock nobody holds is lifted. An app which dies says nothing, so T12 is never triggered for it and its locks would stay: RO10 lifts them at the moment an app asks for the files to treat, which is the moment they would do harm. It is the same principle as RO5 — what is out of date goes at the next request, nobody having asked for it.

The day one interface is left, none of this goes away. A single application running at a time makes the lock useless to anyone but the service itself, and it will then cost one report which serves nothing. What it buys until that day is that the two interfaces cannot take the same file.

No procedure refuses anything before an app is entered, and none appears in either table for that: an app which cannot work with what it received asks for files, and that is PF7 and PF8, not a refusal at the door. RO3

When files are asked for

A person clicks on an app. The app is entered, and it asks the domain for the files it is to treat. Two questions follow, and they do not belong to the same one.

The first is the domain's: is there a workspace? There is none as long as nothing has made one — remotely before any deposit, and on the machine of the person as long as nothing has been installed to manage workspaces for her. The domain then asks the person for her files — having first said what it accepts — and answers the app with the files it asked for.

The second is the app's: is what it received enough? A workspace may be there with nothing checked in it, or with files which are not the ones that app needs. The domain cannot answer that question in its place, knowing neither how many files an app wants nor of which kind. So the app says it, and asks for files.

In both cases what the person is shown is an interface of the domain: the short path locally, the interface of deposit remotely. She is not taken away from the app she asked for — where that interface is shown, beside the app or inside its page, is settled below the organisational level and changes nothing here.

An app must not check the files it treats. Asking for files is not checking them: the interface which asks belongs to the domain, and it is the domain which writes into the workspace, wherever that interface is shown.

The short path

Locally, T02 has two operators, and they do not merge. The short path adds a few files and checks them, nothing more. What manages the workspaces will come beside it, not over it.

The poverty of the short path is not a stage to be passed: it is a strength. Whoever has one file to treat does not want to find herself in a complete interface for managing workspaces and references. The axis is therefore not the deployment but what the person intends: one file to treat now, or a corpus to organise. The occasional use exists locally too, and the short path is it.

The short path also makes the local use possible for whoever has not installed wxpython: without it, T02 has no operator locally, and an app which asks for files asks nobody — the person learns that files are missing and has no way of adding any. It is also the short path which makes the workspace in that case, T02 making one when none exists.

Where the short path is shown — beside the apps, or inside the one which asked for files — changes nothing of what it is. The interface belongs to the domain, and it is the domain which checks.

Locally, the short path browses the disk on the side of the server, which it may, the server running on the machine of the person. The field of a browser does not give a path, it gives a content to upload — and a local file has no need of a copy (T01). That, and not the deployment, is the reason why the two interfaces are two.

Rules of organisation

  • RO1 — The checking is done by the domain, and never by an app which treats files: in the short path, or in what manages the workspaces.
  • RO2 — Remotely, everything which is deposited is checked: one does not deposit in order to keep, one deposits in order to have it treated.
  • RO3 — An app says for itself whether what it received is enough, and asks for files when it is not. The domain judges nothing in its place.
  • RO4 — Remotely, the deposit and the answer to the app are one single request: what carries the files is what hands the workspace over.
  • RO5 — The deletion of the copies which are out of date is done by the server at every request, nobody having asked for it.
  • RO6 — Two questions decide what there is to do, and they are independent: whether the files are already reachable, and whether a workspace exists. The first is answered by the interface the person gives through — the short path gives paths, the interface of deposit gives contents; the second is answered by looking.
  • RO7 — An interface of the domain requires no place of its own, and does not require the person to leave what she is doing. Where it is shown belongs to whoever assembles the software, and changes nothing of whose it is.
  • RO8 — Remotely, the contents travel at the moment the person sends, and not before: nothing of what she composed is kept on the server until then. What travels while she feeds is a name and a size, which is what it takes to accept or refuse a file. In how many goes the contents travel, and under what wrapping, is not of this level.
  • RO10 — A file which is locked and which no app holds is released when an app asks for the files to treat. An app which dies says nothing, and a lock which waited for it to speak would never be lifted.
  • RO9 — No app which treats files receives the workspace of the person: what it receives is made for it, and holds the files it is to treat and nothing else. What manages the workspaces is not one of them — it belongs to that domain, and holds what is its own.

Constraints

What the code holds to

These follow from no need on their own: they are what the code has to hold to in order to serve the needs. They say nothing of the means, which belong to the decisions.

What imposes them is not one thing but four, and the difference matters, a constraint being revised where it comes from: the needs of the person; the model itself, a treatment, a relation or a rule of organisation; the neighbouring domain which gives the place; and whoever runs SPPAS on the machine, who will not have anything written there.

The deposit API is an actor, and it exchanges: it says what it accepts. The last is not one and has not to be — he exchanges nothing, he imposes; he becomes an actor the day what is accepted is said in a setting instead of being written in the code.

B7 and B8 are named nowhere below, and that is not an oversight: they are needs to know what quantity and what size are accepted, and the announcement serves them (T07, F3). A need to know is never what imposes a bound. The same holds of B11, which the announcement answers (T07).

No.ConstraintImposed by
C4What is deposited stays within what the deposit API accepts — a size, a volume, a number of places, a lifetime. None of it is fixed here: it is asked of that domain and relayed to the person.A4
C5The choice of the files gives paths where SPPAS runs on the machine of the person, and contents otherwise. It is what says whether a file has to be brought.T01, and the two interfaces which offer the choice
C6No setting says which case one is in: whether a workspace exists is read, and whether the files are reachable follows from what the interface gives — a path or a content.RO6, C5
C7A deposit does not rename the files.B12, and the workspace being made with the names which were deposited
C9The type of a deposited file is verified on its bytes and not on its name: an executable or a script is not deposited.Whoever runs SPPAS on the machine
C12A file whose name is already taken is not deposited: the first of the name stays, the others are refused.The root: the workspace is made with the names which were deposited, and two files of one name would fall in one root
C14A file an app produced is a sibling of the one it was made from: same path, same root, the extension the person asked for. Remotely, that is the folder of the deposit.The apps, every one of which writes there — the workspace giving the notion of sibling files, not the obligation
C15Where the files stand already, nothing of the deposit API is built, reached or required: the local use works when that domain is absent.The first table of the organisational model: PF1, PF5 and PF7 never

Not one of these constraints carries a number, and none of the bounds of the place is written here any more. What they are worth is the deposit API's to say, and this domain's to relay before the person sends anything.

Logical level

The tables

Each class of entities becomes a table, and its identifier becomes its key.

TableColumnsComes from
FILEmachine, name, size, workspaceThe class FILE, and R3
COPYdeposit, name, sizeThe class COPY, and R1
DEPOSITdeposit, moment, workspaceThe class DEPOSIT, and R4
WORKSPACEworkspaceThe class WORKSPACE

R1 is an aggregation: the aggregated class takes the key of the aggregating one, so a copy carries the name of its deposit, and the two together tell one copy from another. Two deposits carry a copy under one name without carrying the same copy.

R3 has its low cardinality on the side of FILE, which is (0,1): the table takes the key of WORKSPACE, and it may be empty — a file in place is known to the workspace, or to none. R4 has its own on the side of DEPOSIT, which is (1,1): the table takes it too, and it is never empty.

A copy holds no workspace of its own. It is known to the one its deposit was added to, which R1 and R4 already say: a column would repeat two keys and would have to be kept true.

WORKSPACE is a key and nothing else. The table exists so that the others may name it; what it holds is written elsewhere, in the domain which owns it.

Not in the tables: the volume of a deposit, whether a deposit is out of date, whether a file is reachable, the address at which a produced file is reached, and what is handed to an app. All five are computed, and none of them would stay true if it were held.

Physical level

Where each table stands

Here the machines are named, and not before. There is no database: the tables are borne by the disks where the files stand, by what runs between two requests, and by the domain of the workspaces.

TableWhere it standsWhile it runsWhat the person sees
FILE A file on the disk of the machine where it is What the domain of the workspaces holds of it Her file, where she put it
COPY A file written in the place the API gave to its deposit The same Nothing: she sees the name she gave, never where it went
DEPOSIT The place the API gave, holding its copies. It is asked for only at the moment the person sends Before she sends, what is to be sent is held where she stands; from the deposit on, the place and what it holds Nothing of the place. While she feeds, the volume she has fed
WORKSPACE What the domain of the workspaces writes. Remotely it takes the name of the folder which holds the copies, as a workspace of SPPAS takes the name of its own Its object The file manager, and what an app shows of it

What is handed to an app stands nowhere: it is made when the app asks, and it is written down by nobody.

A deposit has two halves and only the second stands anywhere. While the person feeds it, what she has fed is held where she is, the volume is counted there, and nothing is written — RO8 says so, and nothing here may say otherwise. The place is asked of the API, and the copies written in it, at the moment she sends.

Where a place is, what names it, how long it lasts and when it is emptied are not written here. They belong to the API which gives it. This domain knows a place by what that API gave, and knows that it does not last.

Two files of one name, deposited twice, stand side by side without meeting, because two deposits are two places. Within one deposit they cannot meet, C12 seeing to it.

What is worked on is what one request carries, in the three cases. Nothing of a workspace is held on the server between two requests: where the files had to be brought there is nothing to hold, which B6 asks, and where they were in place the one thing which holds the workspace is not this domain. So there is one thing to write and not one per case, and the copy travels with the request which works on it.

Who holds it on the machine is not this domain's to choose, and the way to reach it is not its to invent. Another interface holds a workspace when it runs; the server knows whether it answers, and what it last announced, because that is kept in one place for every application of swapp. Giving a copy back goes through that same place: PF13 asks it. A service which opened a way of its own would be a second one to maintain, and the day the conversation changes there would be two places to read again.

How the domain of the workspaces writes a workspace is not said here: it is its own, it is established, and this document reads it without naming what it holds.

Where the code goes

One module per kind of knowledge, and every procedure has one module and one only. What a module is alone in knowing is what says where a change will have to be made, and what can be tested without the rest.

ModuleWhat it doesProcedure
placeAsks the API for a place, puts the copies there, asks it for an address. The only one which calls itPF1, PF5
acceptanceKnows what SPPAS reads, and relays what the API accepts. It says both, and refusesPF7, and what PF1 and PF8 ask of it
feedingHolds what is to be sent, feeds it, takes back from it, and counts the volumePF8, PF9
chooserAsks the person for files of the machine SPPAS runs on, and gives their path. The only one which opens a dialogPF8, where the files stand already
workspaceMakes files known and checks them, locks and releases, and writes what an app producedPF2, PF4, PF10, PF11
handingMakes the workspace an app receives, and gives itPF3
deliveryMakes the address of a produced file, and serves it when it is followedPF5
provisionThe façade: it puts the tasks of a request in order and calls what does themNone of its own: it is the order of every other
recordWhat one request holds, serialised for the page and parsed back from itNone of its own: every procedure passes through it
viewThe view, building its tree from a recordWhat PF2, PF7, PF8 and PF9 show, and where each file stands
controllerReads the task, rebuilds the record, calls the façade once, has a view populate its treeNone of its own
managerThe entry class: builds the model, the view and the controller, and answers an appNone of its own

A module named here is one file, files_<name>.py, and the classes it holds carry the prefix of the project: the tests name eight of them that way already, from files_acceptance.py to files_view.py. The four last carry no procedure of their own, which is why the organisational level never named them: they are how a request is read and answered, not what it does.

What each one promises, which is the reason for the cutting:

  • The place module is the only one which calls the API, so it is the only one to read again the day that API changes.
  • Acceptance decides nothing about what it has not been given: it answers on a name and on bytes, and relays what the API said of a size, a volume and a count. That is what makes it testable with no disk at all.
  • Feeding is in two halves: the browser holds the file and knows its name and its size, the server says whether it is accepted. Nothing of the content crosses before the person gives, which is RO8 written as a module.
  • The workspace module is the only one which speaks to the domain of the workspaces, so it is the only place to read again the day that domain changes.
  • Handing is the only one which makes a workspace for an app, and that is where the door holds.
  • The delivery is the only one which makes an address.

This domain is a service, not an app. Five of these modules speak only to apps: an app calls them, and there is neither a screen nor a person behind what they answer. Two face a person — where a deposit is fed, and where what was produced is fetched — and those two carry an interface.

An interface here is not an app, and not a page: it is a piece of page, a container an app places in its own. That is what RO7 says in the language of organisation — the domain requires no place of its own — and this is the same thing said in the language of the code.

Where the files are already reachable, three modules have nothing to do — the place, acceptance and the delivery. They carry exactly the three procedures the organisational model leaves empty there. They are therefore not built, and the deposit API they lean on is neither reached nor required. C15

Implementation model: MVC

An app holds the page and receives the request: it is the only one which can, and there is no alternative. A task which belongs to this domain, it dispatches. What is behind that dispatch is this domain's own, and the app sees none of it.

What the app sees of this domain is one object — its manager — and what that object answers: the files it is to treat, whether an event was for it, and a tree to put in its page. It never holds the façade, never holds a deposit, never knows a place.

Three kinds of class, and what each may do

KindWhat it doesWhat it may not do
A view Builds an object — a tree — which whatever answers the request bakes. It is given what it shows Decide anything, count anything, refuse anything, reach a disk or a neighbour, or write a string of its own
The controller Reads the task the request carries, rebuilds a record from what the page transmits, calls the façade, and has a view populate its tree Hold anything between two requests, build a tree, know a place or a workspace — and assemble anything: it is given what it uses, and building the objects of a domain is not the work of what reads a task
The model The façade and its sub-models, which are the whole of chapter on the classes Know that a page exists, or that anything is shown at all

One controller for one view. What was produced is fetched where the app shows it, and not here: the view shows only the files she gave, and where each stands.

What a view builds

A tree is made of the nodes of WhakerPy and of nothing else. An app of swapp holds an HTMLTree, and its view fills the named nodes of that tree — the head, the header, the main, the footer, the script — with HTMLNode and TagNode.

This domain holds no tree of that kind. An HTMLTree is a page; a page belongs to whoever answers a request, and this domain answers none. A view here holds one node, and populate_tree_content(record) builds the children of it.

That node is built under the identifier the app gives, which is the identifier of the node the app chose in its page. A node of WhakerPy carries the identifier of its parent — every node of every view of swapp is made that way — and without it the app cannot append_child() what it asked for. So the app names the place by giving its identifier, the view builds its node under it, and the app appends that node where it said. That is what « a container an app places in its page » means, and it is the whole of what this domain knows of that page. RO7

What a node gives back is its HTML, by serialize(), which is WhakerPy's and is this domain's to call and not to write. An app which bakes a page serializes its tree; an app which answers one piece of a page without baking it again serializes that one node. A view of this domain answers serialize() with the HTML of its node, so that what it built is read without anything outside it knowing which node it holds.

Both answers of an app to a request exist, therefore, and they are the same content: a page which is baked whole, or one node of it serialized alone and sent as data. What this domain answers is the page, as A request, in order says; the day one task answers its node alone, nothing of the design moves but that.

What assembles, and what an app holds

An app is assembled by its maker: it builds the fixed part of the page, then the view, then the controller, and it hands the controller the model and the view. This domain is not an app and has no page of its own, so it has no maker. It has an entry class — a manager — which does the same work for it: it builds the model, the view and the controller, and it is the only thing an app holds of this domain.

That is the counterpart of the rule above. The controller assembles nothing because something else does, and the app holds no façade because it holds the manager instead. What is behind the manager is never named outside it.

How an app knows a task is ours

By asking, and by no convention of names. An app receives the events of a request and consumes what is its own; what it does not recognise, it offers to its services, and a service either consumes it or says it did not. What nobody consumed is an error, and the request is answered as such.

No prefix, no agreed vocabulary of event names between an app and its services: the manager answers whether the event was for it. An app which gains a second service adds one line and nothing else.

What an event is

A name and a value, and a request carries a handful of them in one dictionary. That is what the apps are given — _process_events(events), the key being the name and the value the value — and it makes no difference whether the person sent a form or followed a link: what a query carries is read into the same dictionary as what a body carries.

The names are those of the fields which were sent, so the task is a name like any other: the control which validates carries it, and what the person filled in stands beside it, and so does what the page transmitted. Nothing here numbers the events and nothing names them in a vocabulary of its own, the rule above saying why.

Consuming an event is answering that it was for this domain. An app offers what it did not recognise; the manager answers true when it took it and false when it did not, and nothing else is given back — what is to be shown is read from the record afterwards. An event which nobody consumed is the app's to answer.

The tasks, and what is to be shown

Six tasks are read, and no other name is answered: designate a file, take_back one, send what was fed, the workspace is ready, here is what an app produced, and an app has finished. A request carrying none of them is a first request, whatever else it carries.

What is to be shown is named as well, the views being given a state and deciding nothing: accepted, what may be sent, in a few words; refused, one reason per file, by name; no_place, when to come back, and the control which sends is then not built at all; produced, the files an app made, by root; reachable_until, the hour they go at; finished, whether the app has done. A view shows what is there and nothing else.

A file which was refused is shown in the list beside those which were taken in, marked as refused and counting in no volume: what the person has to correct is where she put it, and not in a message somewhere else.

What the controller is given

That dictionary, as the app received it, and nothing else. It is what handle(data) takes: the record is rebuilt from the entries the page transmitted, the task is read from the entry which names it, and what the person gave is read from its own entry.

What is not understood is dropped, and what is absent takes its default value. A dictionary carrying no entry of this domain leaves a record at its default values, which is a first request. That is the contract of the record and not a courtesy of the controller: it is a page which sends this dictionary, and a page is not a place this domain holds.

What the view shows

The record says what is known, and the view follows from that and not from the task: every file she gave is shown with where it stands — deposited, refused, treated, or no longer reachable. What an app has produced is not shown here: the app shows it, with what this domain gives it (F10). A file which was treated can be neither taken back nor handed again.

The record carries the answer to the second question as well — whether a workspace holds the files to be treated. The organisational level says that question is answered by looking; what looks is the one module which reads the workspaces, and what the record carries is its answer. A view which counted a list to tell the two apart would be a view which decides, and a workspace with no file in it would then be taken for one to be used.

The record says one thing more, and it bears on the deposit alone: whether the files the person designates stand already where SPPAS reads them. It is one entry of its own, and it is said by the app which places the container, which is the one offering the interface she gives through. It is never read from anything else: a view which looked at what the record holds — a workspace, a list — to tell the two cases apart would be a view which decides, and at the first request, before she has designated anything, it would decide wrong. They do, and what she designates is a path, which needs no copy and no place — the files join her workspace as they stand. They do not, and what she designates is a content, which travels and is copied into a place. A view decides nothing, so it cannot be what tells the two apart; it is told, like everything else it shows.

What differs is wider than the control. The bounds go with it: C4 binds what is deposited — a size, a volume, a number of places, a lifetime — and none of it is this domain's to fix, it being asked of the deposit API and relayed. Where the files stand already, nothing is deposited, so there is nothing to bind and nothing to relay: no size to weigh, no volume against a bound, and the announcement which serves B7, B8 and B15 has no object. Binding a corpus of forty gigabytes to the room a shared and perishable space keeps for strangers would forbid the very case the local use exists for.

What does not move: the list, the way a file is taken back out, and that a file may be refused for what it is rather than for its size.

What a view owes the next request

A record serialises itself for transport and parses itself back. What a view builds therefore carries the serialised record with it, so that the next request brings it back. A view which omits it breaks the request which follows — the controller would rebuild an empty record, and a person would see her list vanish without having touched it.

The first request

There is no record. The controller makes one at its default values — nothing fed, no task, no place asked for — and what is shown is the announcement, where there is one, and an empty list. Of the model, only what is accepted is called, and only where the files have to be brought: where they stand already nothing is announced (PF7), and nothing of the model is called.

A request which carries a task but no record is a first request as well. A record which did not come back is a record which was never made, and inventing one would show a person a state she never composed.

The record

What one request holds is an object, and it has a name: the record. It carries what the page transmitted — the task, whether the files stand already where SPPAS reads them, the workspace they are known to, the names and the sizes fed so far where the files have to be brought, and what is to be shown — and it is rebuilt at every request from what came back with it.

That is what lets the two sides find their context again, and the alternative is to keep the state of a person on the machine between two requests — which is exactly what B6 refuses. A record which travels is not a convenience of the code: it is the promise that nothing of her is held.

It travels as a dictionary of strings, one entry per name, which is what a page can carry and what comes back in the events of the next request. serialize() makes that dictionary and parse(data) reads it back. A list is one entry: the record says how it is written and how it is read again, and it is the only class which says it.

The workspace is one of those entries, and it is not written here. The domain of the workspaces writes one and reads it back — sppasWJSON, which the communication of SPPAS and its test app already carry a workspace with — and this domain hands the dictionary it gives to the page and hands back what comes. It holds the files, their roots, their paths and their states, which is the whole of what the person designated: a list of its own beside it would be a second truth, and the day a state changed shape it would differ from itself. What a page sends back and cannot be read as a workspace gives none, and nothing is guessed.

What carries it in the page is one hidden field per entry, in the form which sends. A view builds them from what serialize() gave it and writes none of its own — which is what the paragraph below asks of it. What a field carries is escaped: a workspace is written as JSON, JSON holds quotes, and an attribute which is not escaped is a page which is broken. The names and the sizes fed are entries like the others, and a content is never one. RO8

A container is emptied before it is built. The node of a view lives longer than one request — an app holds the manager, and the manager holds the views — so what was built for the request before is cleared first. Written otherwise, a person would see her list twice, then three times, and the page would carry as many records as she made requests.

A request, in order

  1. The app receives the request and reads the event it carries. It belongs to this domain, so it dispatches it.
  2. The controller starts from nothing and rebuilds its record from what the page transmitted: the names and the sizes, and no content.
  3. It reads the task — designate a file, take one back, send, the workspace is ready, ask for the files to treat, here is what I produced, I have finished — and checks what has to be true before it.
  4. It calls the façade, once. The façade calls what it has to, and answers.
  5. The controller puts in its record what is to be shown: a list, a volume, a refusal and its reason, an hour, addresses, a cause.
  6. The view populates its tree from that record.
  7. The app puts that tree in its page, where it chose, and bakes the whole.

Step 4 is the only one which reaches anything: a disk, a workspace, an API. Steps 2, 3, 5 and 6 run on what they were given, which is what makes them testable without a machine.

And the request which carries a content is the one which sends, and that one only. Every other request of this domain carries names, sizes and a task. RO8

UML

The classes of the model

/ marks what is derived and held by nobody. What the operations promise is the chapter on the contracts.

ClassFromAttributesOperations
FileProvisionthe façade—what_is_accepted(), feed(), take_back(), send(), ask_for_files(), make_known(), works_on(), files_for_app(), lock(), release(), produced(), finished()
DepositAcceptancemodule acceptance—what_is_accepted(), accepts(), accepts_volume(), accepts_one_more_deposit(), accepts_content()
FilePlacemodule place—what_is_accepted(), ask_for_a_place(), when_there_will_be_room(), put(), why_not(), address_of(), path_of(), serve()
WorkspaceAccessmodule workspace—make_workspace(), make_known(), check(), checked_files(), locked_files(), exists(), is_known(), known_files(), workspace(), works_on(), give_back(), lock(), release(), remove(), write_produced(), validate_filenames()
FilesForAppmodule handing—for_app(), back_from_app()
ResultDeliverymodule delivery—address_of(), serve()
DepositDEPOSITplace, files, /volumefeed(), take_back(), volume()
DepositedFileCOPYname, size, content—
noneFILE, WORKSPACEA file in place is named by the domain of the workspaces, which has a class for it already, and a workspace is that domain's own

The feeding module has no class of its own: what it holds is a deposit being fed, rebuilt from what the page transmits at every request, and kept between none of them. It is the controller which rebuilds it.

The browser gives a content and never a path, so where the files stand already the path is asked for where they are: on the machine the server runs on, by the file chooser of SPPAS, which one class of this domain calls and no other. What a dialog gives back is read and never guessed — one name, several, or nothing — and a person who chose nothing adds nothing.

Three operations make a copy live, and they are the whole of it. works_on() puts on it what one request carries, at every request; the operations which make known, check, lock and release work on it and on nothing else; and give_back() hands it to whoever holds the workspace, once, when an app has finished — which is PF13. A copy which was never given back changed nothing, and that is what makes an app stopping halfway harmless.

FileProvision.make_known() is the way in of the files which stand already where SPPAS reads them: they are made known and checked, and nothing is copied and nothing is asked of the deposit API. It is send() without the half which brings the files, which is what the organisational level says of the first of its two tables.

A workspace and the files it holds are not written again here. They are sppasWorkspace and the classes of that domain, which name a file and hold its state already. This domain asks them and sets them; a class of its own carrying the same thing would be a second truth.

Deposit.feed() adds and counts; it does not accept. Whether a file may be fed in is DepositAcceptance's answer, and the façade asks it first. A data class which decided what it may hold would hold the rules as well as the data, and the rules would then be in two places.

FilesForApp does not speak to the domain of the workspaces, and that is deliberate: the promise that one class alone speaks to it would be false the moment two did. It asks WorkspaceAccess for the files which are checked and for a workspace holding them, and it holds the rule that the one of the person never leaves.

One class holds a state, and it is Deposit. The others are given what they work on and give back what they made. That is why nothing here has to be invalidated when something changes upstream, and why each of them is tested on its own.

What is tied to what

TieLegsWhat it is
holdsFileProvision 1 — 1 WorkspaceAccess, FilesForAppA composition: the façade makes them, and they go when it goes
holdsFileProvision 1 — 0..1 DepositAcceptance, FilePlace, ResultDeliveryA composition, made only where the files have to be brought. C15
holdsDeposit 1 — 1..n DepositedFileA composition: a file of a deposit exists only inside it
usesFilePlace → DepositA dependency: it writes them and forgets them, and keeps none
usesFilesForApp → WorkspaceAccessA dependency: it asks for what is checked, and for the workspace it will hand over
usesWorkspaceAccess → sppasWorkspaceA dependency, and the only tie of this domain to the neighbouring one
usesResultDelivery → FilePlaceA dependency: what an app produced is a sibling of what it read, so it stands in the folder of the deposit
noneDepositAcceptanceTied to nothing at all: it answers on names and numbers handed to it

In yUML

To be read at yuml.me, class diagram.

[FileProvision|what_is_accepted();feed();take_back();send();ask_for_files();make_known();works_on();files_for_app();lock();release();produced();finished()]++1-0..1>[DepositAcceptance|what_is_accepted();accepts();accepts_volume();accepts_one_more_deposit();accepts_content()]
[FileProvision]++1-0..1>[FilePlace|what_is_accepted();ask_for_a_place();when_there_will_be_room();put();why_not();address_of();path_of();serve()]
[FileProvision]++1-1>[WorkspaceAccess|make_workspace();make_known();check();checked_files();locked_files();exists();is_known();known_files();workspace();works_on();give_back();lock();release();remove();write_produced()]
[FileProvision]++1-1>[FilesForApp|for_app();back_from_app()]
[FileProvision]++1-0..1>[ResultDelivery|address_of();serve()]

[Deposit|place;files;/volume|feed();take_back();volume()]++1-1..*>[DepositedFile|name;size;content]

[FilePlace]-.->[Deposit]
[FilesForApp]-.->[WorkspaceAccess]
[WorkspaceAccess]-.->[sppasWorkspace]
[ResultDelivery]-.->[FilePlace]

[sppasWorkspace]-[note:class of the neighbouring domain. Only WorkspaceAccess speaks to it]
[Deposit]-[note:volume is the sum of the sizes and is not held. place is what the API gave. content is absent until the person sends]
[ResultDelivery]-[note:a produced file is a sibling of the one it was made from. Same path, same root, so it stands in the folder of the deposit]

The classes of the view

ClassOperationsWhat it shows
DepositViewpopulate_tree_content(record), serialize()DepositViewpopulate_tree_content(record)What a person feeds: what is accepted, the button, the list, the volume against the bound, what sends, and where each file stands

A view builds a tree and does nothing else — it decides nothing, counts nothing, refuses nothing, and reaches neither a disk nor a neighbour. What it shows was decided before it was called. There are two and not one because what a person sends and what she takes back are asked for at different moments, by different apps, and one of them without the other.

A view writes no title. A title stands in the plan of a page, at a level the page alone knows: a service writing one would impose a rank in a document it does not see. The container is a section carrying aria-label, so that it is named for whoever reads the page without seeing it, and the app writes the heading it wants above it. The files are the items of a list: the panel is a <ul> and a card a <li>, as every panel of cards of swapp is written, so that how many files there are is said.

What is tied to what

TieLegsWhat it is
usesthe view → FilesRecordA dependency: it is given it and builds from it
nonethe viewTied to nothing else: it is given a state and gives back HTML

In yUML

[DepositView|populate_tree_content();serialize()][DepositView|populate_tree_content()]-.->[FilesRecord]

[DepositView]-[note:builds a tree and nothing else. Decides nothing, counts nothing, refuses nothing]

The classes of the controller

ClassAttributesOperations
FilesControllerrecordhandle(data), populate_view()
FilesRecordtask, reachable, has_workspace, workspace, fed, to_be_shownserialize(), parse(data)
A record comes from no table: it is what one request holds, it serialises itself for transport and parses itself back, and it is held by nobody between two requests
FilesManager—files_for_app(), lock(), release(), produced(), consumes(events), is_ready(), start_over(), populate_view()

FilesManager is what an app holds, and the only object of this domain it holds. Where an application of swapp is reached by a URL and answers with a page, this domain is reached by the app which placed its tree: what answers is the app's response and not one of its own, and this class is where that difference stands.

What is tied to what

TieLegsWhat it is
holdsFilesManager 1 — 1 the façade, the view, the controllerA composition: it builds them, and they go when it goes. It is what the rule « the controller assembles nothing » leans on
holdsFilesController 1 — 1 FilesRecordA composition: one record per request, made by the controller and kept by nobody
usesFilesController → FileProvisionA dependency: it calls the façade, once per request
usesFilesController → the viewA dependency: it hands it what to build from, and reads nothing back but HTML

In yUML

[FilesManager|files_for_app();lock();release();produced();consumes();is_ready();start_over();populate_view()]++1-1>[FileProvision]
[FilesManager]++1-1>[FilesController|record|handle();populate_view()]
[FilesManager]++1-1>[DepositView]
[FilesController]++1-1>[FilesRecord|task;reachable;has_workspace;workspace;fed;to_be_shown|serialize();parse()]

[FilesController]-.->[FileProvision]

[FilesController]-[note:called once per request. Holds nothing between two, and assembles nothing]
[FilesRecord]-[note:what one request holds. It travels with the page, which is what keeps nothing of a person on the machine]

The states

A deposit
StateWhat is true
FedIt holds names and sizes, it makes a volume, and it stands where the person stands. Nothing of it is on the server
SentIt holds the place the API gave, and its copies are written there
GoneIts place did not last. The API emptied it, and nothing here was asked

A deposit which is fed and never sent leaves nothing: it was never anywhere but where the person was. That is why an abandoned deposit is not a case to be treated.

A file of the workspace, as this domain sees it
StateWhat is true
CheckedIt is to be treated, and it is in what is handed to an app which asks
LockedAn app has taken it. It is no longer checked, so it is in nothing that is handed

The two other states belong to the domain of the workspaces, and this one neither reads nor writes them.

The sequence, when an app asks

  1. The app asks for the files it is to treat.
  2. A workspace exists: what is handed is made from it, holding the checked files and them only, and the app receives it. The sequence ends here.
  3. No workspace exists: what is accepted is said, and what is not — the space being full — is said as well, with when to come back.
  4. The person feeds what she is about to send, and is answered on each file as she adds it: the name, the size, the volume so far.
  5. She sends. The contents travel then, and not before.
  6. The types are verified on the bytes, the copies are written in the folder of the deposit, and what was refused is said.
  7. The files are made known to a workspace, which takes the name of that folder, and those to be treated are checked in it.
  8. The app is answered, as in step 2.
  9. It takes a file, which is locked; it gives it back, which unlocks it; as many times as it works.
  10. It gives back the workspace it was given, as often as it has something to give back: what it produced is written into the workspace of the person, and checked there.
  11. It says it has finished, and what it still held is released.
  12. What was produced is made reachable: it is already where the person reads it, or an address is made for each file.

Steps 3 to 7 happen only where the files have to be brought. Where they are already reachable the person feeds a workspace outside of any app, and step 2 is the whole of it.

The error policy

LevelWhat happensWhat is done
1Nothing can be done: the deposit API gives no placeNothing is deposited. The person is told, and told when to come back
2One file is concerned: a name already taken, a size beyond what the machine accepts, a type refused on its bytesThat file is not deposited, the others are, and what was refused is said with its reason
3Whoever runs the machine has to know: a folder which cannot be written, a workspace which cannot be madeSaid where he reads, and the person is told that nothing could be deposited

What is raised is caught by whatever answers a request, and by nothing below it. A person is never shown what a machine says to itself, and never left before a page which does nothing without a reason.

What an app failed to do is not in this table. It is no error of this domain: a file an app made nothing of, and why, is the app's to state, and to show beside the file it concerns. This domain neither judges it nor rewords it, and stops nothing — the other files come back as they were made. B16

The contracts

How to read them

pre is what has to be true on the way in, and what the operation does not check; post is what the caller can count on without looking. The operations are named by what they do and not by a signature: a signature invented before the code is a name nobody will use, and the modules are named here as the level above named them.

What holds everywhere

  • What is absent gives back an empty thing — an empty name, an empty list, a volume of zero — and never nothing at all.
  • What is handed to an app shares nothing with the workspace of the person: no object, no file, no way back to it. Every other promise of this domain rests on that one.
  • Only the workspace module speaks to the domain of the workspaces. No other class of this domain knows it exists.
  • What is raised is caught by whatever answers a request. No module below it writes a catch.

Class by class

acceptance
OperationContract
Say what is acceptedpre: none. post: the bounds, the extensions which are read, and that nothing of what is sent is kept. It depends on no file and on no deposit
Answer on a namepre: none. post: refused when the name is already taken in what is being fed, and the reason is given with the refusal
Answer on a size, and on a volumepre: a size and a volume of zero or more. post: refused beyond what the machine accepts, and beyond the volume of one deposit
Answer on a count of depositspre: none. post: what the deposit API answered, relayed as it was given, with the hour to come back
Answer on a contentpre: the bytes are those of the file. post: refused when what they say of the type is an executable or a script. The only operation of this class which needs a content

This class reads no disk, writes nothing, and knows no workspace. Every rule of what is accepted is therefore checked without anything being installed, which is what makes it the first to be tested and the last to surprise.

feeding
OperationContract
Feed a file inpre: a name and a size. post: the file is in what is to be sent, and the volume is that much greater — or nothing has changed and the refusal is said with its reason. Nothing of the file has travelled
Take a file back outpre: none. post: it is no longer in what is to be sent, and the volume is that much less. Taking back what is not there does nothing wrong
Give the volumepost: the sum of the sizes fed, zero when nothing was fed
Give what is to be sentpost: the names and the sizes, in the order they were fed. May be empty

This class holds nothing between two requests: what is to be sent is rebuilt from what the page transmits, each time. It decides on the server, on a name and a size, the content staying where it is until the person sends. What she fed is lost if she goes away, and an abandoned deposit leaves nothing behind.

place
OperationContract
Say what the API acceptspre: none. post: a size, a volume, a number of places, as that API says them. Nothing is fixed here
Ask for a placepre: none. post: a place, or a refusal with the hour at which there will be room. Neither is invented here
Put a copy in a placepre: the place was given. post: the copy stands there under the name the person gave it
Ask for an addresspre: the file stands in a place. post: an address which leads to it and dies with it
Say when there will be roompre: none. post: whether the last place asked for was refused, and in how many seconds there will be room. Neither is invented: both are what that API answered
Say why a file is refusedpre: none. post: the reason that API gave, as it gave it, and nothing written here
Say where a copy standspre: none. post: the name that copy stands under on the machine, with its path, which is what a workspace is made with; nothing at all when the place is out of date or holds no such file
Serve what an address namespre: none. post: what that API answers, handed on untouched
handing
OperationContract
Make what an app receivespre: none. post: a workspace holding the files to be treated and them only, sharing nothing with the one of the person; empty when nothing is checked, and never nothing at all. What was still locked has been released first: a lock no app holds is lifted here. RO10
Take back what an app givespre: what is given back was made by this class. post: the files the app added, and nothing of what it may have changed elsewhere

« Sharing nothing » is the one promise a test has to hold on to: a change made in what an app received is never seen in the workspace of the person, whatever the app does with it.

workspace
OperationContract
Make files known, and check those to be treatedpre: the files are reachable. post: every one of them is known, and those to be treated are checked. No content is read
Lock a filepre: the file is known. post: it is locked, therefore no longer checked, therefore in nothing that is handed — in the copy, and on the workspace which is held when that one knows it. Whoever holds it is told at once
Release a filepre: none. post: it is checked again, on both, and whoever holds the workspace is told. Releasing what is not locked does nothing wrong
Write what an app producedpre: the files come from what the app gave back. post: they are known and checked, and nothing which was checked before has been unchecked
Give the files which are lockedpre: none. post: the files an app is treating, which may be none. It is what a release with no name given releases
Say whether a name is knownpre: none. post: true when the workspace holds a file of that name. It is what tells a file an app produced from one it was given
Say whether a workspace is there to be usedpre: none. post: true when it holds files. One which holds none is one to be filled, and it is what tells the two local cases apart
Work on the copy a request carriespre: none. post: what is made known, checked, locked and released from then on is that copy, and nothing which holds a workspace has been reached
Give the copy backpre: an app has finished. post: every file of the copy which was added, checked or unchecked is so on the workspace which is held, and nothing else of the copy is: a file taken out of it is not taken out there, and a state this domain does not set is not set there. Whoever holds it is told once, and only when something was reported. Nothing at all is done when no workspace is held
Give the workspace it works onpre: none. post: the workspace itself, which is what a request carries from one to the next. It is never what an app receives: that one is made by the handing
Take files out of a workspacepre: none. post: they are no longer known to it. Taking out what is not known does nothing wrong
Give every file of a workspacepre: none. post: every file it holds, whatever its state, the three levels being walked to get them. A workspace gives its files by state and never as a whole
Answer on a list of namespre: none. post: the names as they were given, or a refusal: a single name given instead of a list would be walked letter by letter
delivery
OperationContract
Make the address of a produced filepre: the file exists where the app wrote it. post: an address which leads to it, and which lives exactly as long as the file does
Serve what an address namespre: none. post: the file, or nothing at all when it is out of date or when the address names none. Nothing else of the machine is ever reached through an address

The last clause is not a nicety: an address the domain makes is followed by whoever holds it, and what it can reach is what the domain is answerable for.

the controller
OperationContract
Be builtpre: a model and a view are given to it. post: a record with its default values, nothing read and nothing called
Handle what the page sentpre: none — what carries no task of this domain gives the record back to its default values. post: the record holds what the page transmitted, the façade has been called at most once, and nothing is held after it answered
Rebuild what is fedpre: none. post: the record holds exactly the names and the sizes the page transmitted, in the order they were fed; empty when it transmitted nothing. No content, ever
Populate the viewpre: what the page sent has been handled. post: the view has built its tree from the record, and the controller has changed nothing meanwhile

It never raises. What goes wrong is put in the record and written where whoever runs the machine reads it — a refusal with its reason, an hour to come back — because a person is never left before a page which does nothing without a reason. That is what the controllers of the apps already do, and this one does not invent another way.

the manager
OperationContract
Be builtpre: none. post: the model, the view and the controller exist and are tied; nothing has been read, called or shown
Answer whether an event was for this domainpre: none. post: true when it was consumed, false when it was not — and nothing is changed in that second case. It is never an error here: what nobody consumed is the app's to answer
Say whether the workspace is readypre: an event was consumed. post: true when the request carried ready (E7), false otherwise. Nothing is changed
Give an app the files it is to treatpre: none. post: what the façade answers, handed on untouched
Take note of what an app holdspre: none. post: the files it takes are locked and the files it gives back are checked, in the copy and on the workspace which is held; an app which says nothing holds nothing, as far as this domain and the other interface can tell
Start overpre: none. post: the container shows the deposit again, with no file in it; the files are known to a new workspace, holding none. The workspace given when the manager was built is not altered
Populate a viewpre: an event was consumed, or it is a first request. post: the tree is built from the record
the record
OperationContract
Serialise itselfpre: none. post: what a page can carry and a next request bring back, holding names, sizes, a task and what is to be shown — and no content, ever
Parse what came backpre: none. post: the record holds what was transmitted; what was not transmitted takes its default value, and what is not understood is ignored rather than guessed
Be made with nothingpre: none. post: no task, nothing fed, nothing to show — which is a first request

A record parses what came back and never trusts it further than that: it is a page which sends it, and a page is not a place this domain holds. What is not understood is dropped, and the person sees a state she can still correct.

the view
OperationContract
Populate the tree of a depositpre: the record comes from the controller. post: what is accepted, what has been fed, the volume against the bound, every refusal with its reason, and what sends — and nothing the record did not say
Populate the tree of a workspace which is therepre: the record says the files stand where SPPAS reads them, and that a workspace holds some. post: the name of the workspace, and nothing else: no list of files, no control which designates, none which validates, no bound. A workspace which is there is used, so nothing is asked of her — she is told which one it is
Populate the tree of a deposit which goes into the workspacepre: the record says the files stand where SPPAS reads them. post: a control which designates a file by its path, the list of what was designated, and what validates it. No bound of any kind is shown, and no file is marked refused: C4 binds what is deposited, C7 to C12 bind what is deposited, and nothing is deposited here — the organisational level saying it in one line, « the announcement exists only where there is a refusal, and nothing is refused here »
Populate it when no deposit can be madepre: the record says there is no place. post: no control which sends is built at all. Not one which is built and disabled: one which is not there
Show where each file standspre: the record comes from the controller. post: every card carries the state of its file — deposited, refused, treated, or no longer reachable — as an icon whose text alternative is the word; a treated file cannot be taken back, and once the batch was treated, Done is disabled. B17
Give what was builtpre: the tree was populated. post: the HTML of its node and of what stands under it, and nothing of a page: no head, no header, no footer. It is the node of the view which is serialized, and WhakerPy which serializes it
Empty what was built beforepre: none. post: the container holds what this request says and nothing of the request before. The node is the same from one request to the next, and what it held is cleared before it is built again
Carry the record backpre: none. post: what is built holds the serialised record, so that the next request brings it back. A tree without it breaks the request which follows

A view builds a tree, which is baked into HTML by whatever answers the request. It is not given a page to write into and it writes no string of its own: that is the shape the apps already have.

Three promises hold for both, and they are what a test holds on to. A view is called with everything it needs and asks for nothing. The same record gives the same tree — no clock read, no order which shifts. And a view never writes what it was not given: no path, no place, no name of a folder, nothing of the machine. What the person may see was chosen before the view was called.

What is tested, and where

Without a disk

On a machine where nothing is installed: no place, no API, no workspace, no server, no person.

No.What is checkedWhat it holds
TE1What is accepted is said before anything is sent, and depends on no file and on no depositB7, B8
TE2A name already taken in what is being fed is refused, and the reason is given with the refusalC12
TE4A size beyond what the machine accepts is refused; the size one under it passesC4
TE5A volume beyond that of one deposit is refused; the volume one under it passesC4
TE6A count beyond the number of deposits is refused, and the refusal says when to come backC4, relayed and not invented
TE7A handful of bytes which say an executable or a script is refused. The only check which needs a contentT01
TE8A file fed in raises the volume by its sizeT08
TE9A file taken back lowers it, and taking back what was never fed does nothing wrongT09
TE10What is to be sent comes back in the order it was fedT08
TE11Nothing of a content travels while the person feeds: what is held is a name and a sizeRO8
TE12A state handed to a view gives a tree which holds what that state said and nothing more: no refusal it invented, no total it countedD1
TE13A state which says nothing gives a tree which says nothingD1
TE14What is handed to an app holds the checked files and them onlyB1, RO9
TE15Everything in what was handed is changed, emptied and added to — and the workspace of the person has not movedRO9
TE23The same state gives the same tree, twice: no clock is read, and no order shiftsD1
TE24A refusal is marked on the file it refuses and on no other, with the reason it came with; a refused file stays in the listC12
TE25Where there is no place, no control which sends is built at all — and what she fed stands as it wasThe contract of the view
TE26A view writes nothing it was not given: no path, no place, no name of a folderB6
TE28What a dialog answers is read and never guessed; what she chose joins the workspace as it stands, checked, and choosing nothing adds nothingC5
TE27Where the files stand already: the paths are listed, no bound is shown, no file carries a mark of validity, and the control is not the one which gives a content — before anything is designated as well as afterC5, C6
TE29Where the files stand already, the service is built and answers every task with no deposit API: nothing of it is built, no place is asked for, nothing is announcedC15
TE30ready sends nothing and asks nothing of the deposit API; is_ready() answers true after it, and false after any other taskE7
TE31start_over() gives a container which shows the deposit again, and files_for_app() hands no file afterwardsThe contract of the manager

TE23 to TE26 are what a view promises, and they need nothing but a state handed to it: the same state twice, a refusal shown where it belongs, a control which is not built, and nothing written which was not given.

TE1 to TE7 are the whole of what acceptance does. It holds every rule of what is accepted and reads nothing, so all of them are checked with no place and no API at all. Each refusal gives its reason, and the refusal on a count gives when to come back.

TE11 is RO8 written as a test. A test which found a file written on a server before the person gave would be a test which found that rule broken.

TE12 and TE13 catch a view which decided something. A view which counted a total or invented a refusal is caught by a state which says nothing at all.

TE15 is the one test the whole design rests on. A door which is not tested is a consigne.

With a disk

No.What is checkedWhat it holds
TE16A place is asked of the deposit API and obtained; a copy is put there under the name it was given; an address leads to itT01, T05
TE17A refusal of that API is relayed as it was given, with its hour, and nothing of it is invented hereF13, D2
TE18An address reaches its file, and nothing else of the machineB13
TE19Nothing at all when the file is out of date, and when the address names noneB13

TE16 and TE17 are the only tests which need that API, the place module being the only module which calls it.

With the domain of the workspaces

No.What is checkedWhat it holds
TE20Locking a file makes it no longer checked, so it is absent from what is handed next: checked by handing twice around a lockT10
TE21Releasing it puts it back among what is handedT11, T12
TE22Writing what an app produced unchecks nothing of what was checked beforeT04

The workspace module is the only one which needs that domain to run, and these three are the only tests which do.

What no test covers, and where they stand

  • What an app does with what it received: it is the app's, and this domain is answerable only for what it handed and for what came back.
  • How the domain of the workspaces writes a workspace: it is established, and it has its own tests or it has not.

TE1 to TE15 are the ones to write first. They need nothing to run, and they hold the whole of what was decided: what is accepted, what is counted, and the door. The seven others need a disk or a neighbour, and they check that what was decided was also done.

They stand where the project puts its own: in tests/swapp/, which follows the shape of the sources.

The decisions of the tool

What is decided here

The bounds of a place and how long it lasts are not decided here: they are the deposit API's, and its dossier holds them with the reason for each. What this domain decides of the tool is what follows.

D1. No business logic in the view. What says whether a file is accepted is SPPAS, which alone knows what it reads, and the deposit API, which alone knows what it takes. Deciding it in the page would put half the rules in one language and half in the other, and would have to be written twice the day one of them changes.

D2. One module calls the deposit API, and one only. The day that API changes, there is one file to read again. It is the same reason which keeps the domain of the workspaces behind a single module.

Decided elsewhere

Two decisions of the tool are written where they are read, and are named here so that this chapter is the place one looks: a workspace takes the name of the place which holds the copies, said where each table stands; and the bounds, the duration, what names a place and when it is emptied, which are the deposit API's and are written in its dossier.

What was set aside

Considered, and decided against

These are not missing. Each was written, weighed, and left out for the reason beside it — which is what keeps the question from being reopened in six months, and answered the other way for want of the reason.

WhatWhy
Sending the contents as the person feeds, rather than when she sends A composition which takes an hour would expire under the person making it, and be deleted by the request of somebody else. A deposit cannot begin to age before it exists
Refusing a whole deposit because two of its files bear one name The domain cannot see how files group in any case, the folder they were taken from not travelling with them. Refusing everything would cost two hundred files for one collision, and would not buy what it was meant to buy
Refusing to enter an app, before it is entered, for want of files Only an app knows what it needs — one file, a sound, two of them. A launcher can ask whether anything is checked and nothing more, which never relieves the app of the case. It doubles a responsibility instead of taking one
Handing an app the workspace of the person A rule an app is asked to respect is not a door. What is handed is made for it, so what it can damage is its own
Offering an app a list of files or a workspace, whichever suits it Two contracts to hold for one need, two ways of giving back, and no gain: the apps already speak the workspace, and those which work by root need what a list does not carry
Deciding in the page whether a file is accepted The rules would live half in one language and half in the other, and would be written twice the day one of them changes. What is read online is the exception, and the logic has no reason to emigrate for it
Waiting for an app to have finished before giving back what it produced A design which forbade giving back as one goes would forbid what no need asks to forbid, and the person would wait for the last result to see the first
Making this domain the gate through which anything touching a workspace must pass A gate one can walk around is not a gate: nothing obliges an app to call it. What makes the door hold is what is handed, not a rule — and each writes what it is responsible for

Left open

These are neither decided nor dropped. They are known, and they wait.

  • One word is not settled: the one for a file designated and not yet duplicated. What is sent at one time is written deposit throughout, and that one is settled.
  • Settled. Where the files stand already, what the person designates is a path, and the record carries it inside the workspace the files are made known to: the two lists which would have said the same thing are one.

Annexes

Annex: Mockup of the interface

This annex is not a picture of a page. It is a piece of page — the fragments below are HTML, styled by Whakerexa, rendered here by the same stylesheets that will render wherever an app places them. Interactions are inert; the structure, the labels and the wording are not.

Three of the five fragments are what the view builds, copied here as they came out of swappDepositView: what is read here cannot differ from what an app shows, and the day this document is served, they are written between the two marks rather than copied. The two others are not of this service — a dialog, which belongs to the app, and a sending, which belongs to what makes the contents travel — and they stay as they were drawn.

The wrapping div which puts two of them side by side is of this annex and of nowhere else: a view builds a section, and where it stands is the app's.

Two fragments side by side, because the same view is read at two moments: before an app runs, and once the batch was treated. Where each file stands changes; nothing of what was produced is shown, which is the app's to show. A page shows one of them, never both.

Three more fragments follow them, which are this same view in the states it takes apart from the ones above. Only what differs is drawn: the deposit itself is not repeated.

  • No place to be had. The dialog, and nothing else. Her list stands as it was, and the control which sends is left out — not built and disabled: not built.
  • While it is being sent. The contents travel, which is the one long moment of this domain, and the one where a proportion can be said: the volume fed is known. It stands where the control which sends stood.
  • Deposited into the workspace. The files stand already where SPPAS reads them, so what she designates is a path, and it goes straight to her workspace: no copy and no place. And no bound either — the bounds are the deposit API's, they bind what is deposited (C4), and here nothing is: a corpus is not weighed against the room a shared space keeps. The list and the way back out do not move; the control differs, the bounds go, and what validates says the act and not a destination which may not exist yet, T02 making a workspace when it finds none. Nothing is refused here: a file is deposited, then treated.
  • 3355443 record-01.wav
  • 0 record-02.wav

    This name is already taken.

3.2 MB of 100 MB accepted here. Up to 10 MB per file.

  • record-01.wav
  • record-02.wav

Every place is taken. A new attempt will be made in 4 min 32 s.

What you added will be cleared, and this page will start again.

Sending

42%

record-02.wav

  • record-01.wav
  • record-02.wav

What the mockup settles, and what it does not

The two moments never stand on one page together: a page shows the files she gave as they stand now. Placing them side by side here is a convenience of reading, not a layout being proposed.

A refusal touching the whole deposit — no room now, and when to come back — is not shown here: it goes to the dialog of the app, of which every app already has one for information and one for error. Only a refusal touching one file is marked in place, on that file, which is the one thing an app's dialog cannot say by itself.

What marks a file is aria-invalid, not an invented flag: wexa.css already colors a field so marked, in the same red and green shown here. The icon repeats what the color says for whoever cannot read the color, and names it besides — the reason of a refusal is read on the file it refused, not guessed from a border.

A size is shown in bytes, because a size is what the view was given and a view counts nothing. Turning 3355443 into 3.2 MB is a decision, and it is taken where the record is filled, not where it is read.

A root from which nothing came stands in the same list as the others, and carries the sentence the app gave for it. Those words are the app's: this domain does not compose them, does not shorten them, and does not put the file out of the list for want of a result.

Each list is a tree, not a table: what populate_tree_content builds. A root groups the files produced from it, and nothing in the fragment counts them, refuses them, or judges a name — that was done before the fragment was built, and none of it happens again here.

The bounds stated above — 10 MB, 100 MB — are read from the deposit API and said as it gives them; this domain decides none of them, and its dossier holds the reason for each.

Every fragment stands in a form, and the form carries what the next request brings back: one hidden field per entry of the record, written as the view was given them and escaped, a workspace being JSON and JSON holding quotes. Nothing of it is shown, and nothing of it is optional: a fragment built without them is a page which loses the list of the person at her next gesture. The values above are cut short for reading; what a page carries is what the record serialised, whole.

Annex: Legal notices

  • Author: Brigitte Bigi
  • Document License: GNU Free Documentation License (GFDL) 1.3
  • Copyright (C) 2026 Brigitte Bigi, CNRS
  • Creation Date: 2026-09-11
  • Last update: 2026-09-13