Books / Law as Code in Practice: French Family Benefits / Chapter 9
Part III · Chapter 9
A Human Must Decide: Decent Housing

Contents of Law as Code in Practice: French Family Benefits
You will follow three versions of one family’s file: assessment pending, housing found decent, housing found not decent. By the end you will know what the model answers when a condition rests on a person’s assessment, whom it asks, and how each answer changes the file — including the duties and the protection that arise when the housing is found not decent.
Lawyer: who assesses decency, and what the law attaches to each answer.
Analyst: what the fund can already calculate, and what waits for the assessment.
Developer: how a request to an authority appears in an answer, and how the authority’s answer enters a case.
1. The question
In Chapter 4 the model calculated the Garniers’ housing allowance: €189.95295 a month. One condition was left open: the house must be decent. Whether it is depends on evidence about the dwelling — damp, heating, floor space, safety — not on a formula.
Make a prediction: before anyone has assessed the house, does the model say the family is entitled, is not entitled, or something else?
2. The text
Article L. 822-9 of the construction and housing code, in the edition in force on the case dates (from 31 December 2023; the text is unchanged in the edition of 1 July 2026), opens with:
Pour ouvrir droit à une aide personnelle au logement, le logement doit répondre à des exigences de décence…
In English: to open a right to housing aid, the dwelling must meet the decency requirements defined under article 6 of the 1989 law on rental relations, with details set by regulation. Decency is a legal standard assessed from evidence: the landlord provides a certificate (R. 823-2), and under L. 843-1 a finding of non-decency is made by the paying body or by a body it has accredited. This model addresses the decency question to the paying body.
Glossary: décence → decency → logement_decent; organisme payeur → paying body → OrganismePayeur; allocation conservée → the fund keeps the allowance → conservation_en_cours.
3. In the model: a question addressed to an authority
The model does not turn decency into a fact the case types in. It declares it as a judgment and names who gives it:
pub external judgment relation logement_decent(m: Menage) {
authority OrganismePayeur;
label fr official "le logement répond aux exigences de décence";
}
rule DroitOuvert(m: Menage) defeasible {
when secteur_locatif(m) and occupation_residence_principale(m)
and logement_decent(m);
then droit_ouvert(m);
}
(Source anchors are left out here; both declarations are tied to L. 822-9, and the rule also to L. 822-2.) Within this model’s scope, the rule opens the right for a tenant whose home is the main residence and whose housing has been assessed as decent; other eligibility requirements sit in other rules. The first two conditions are facts of the case. The third is a question the model addresses to the paying body.
4. Three files, three answers
The case package for this chapter has three versions of the Garniers’ file. All three share the household, the house, the rent and the application. The first two are dated 15 April 2026; the paying body’s answer is the one thing that sets them apart. The third is dated 15 May 2026 and adds the finding of 28 April, zero recoverable charges, the allowance amount the fund has told the family, and the fact that the family was informed.
| Question | Assessment pending | Found decent | Found not decent (28 April) |
|---|---|---|---|
| Is the right open? | not established — requires judgment, addressed to the paying body | established | not established, nothing further to ask |
| Housing allowance as calculated (€189.95295) | established | established | established |
| Does the fund keep the allowance? | not established | not established | established |
| Rent the family pays (€1,130.04705) | not established | not established | established |
| The fund must pay the allowance | — | active duty | — |
Answers recorded on 11 October 2026 against the pinned canon fr.apl 0.1.0.
5. Before the assessment
With no answer yet, the model says not established — and, in the same answer, why. This is the recorded result, trimmed:
{
"evaluationStatus": "REQUIRES_JUDGMENT",
"truthStatus": "NEITHER",
"judgmentRequests": [{
"predicate": "urn:fr:corpus:clir:apl#logement_decent",
"authority": "urn:fr:corpus:clir:apl#OrganismePayeur",
"request": {
"relation": "urn:fr:corpus:clir:apl#logement_decent",
"args": [{ "kind": "entity_ref", "id": "urn:law:examples:fr:garnier:menage" }]
}
}]
}
(The request also carries its polarity, an id and a proof hash.) This is the point of the chapter. A pending assessment is not a refusal, and it is not a fact the family forgot to give. It is a question with an addressee: a caseworker sees exactly what is open, for which household, and who must answer it.
Meanwhile, the rest of the file keeps working. The calculated amount, €189.95295, is established. The positions already in force are active: the household must attach the supporting documents (R. 823-2) and must not claim aid for several dwellings at once (R. 821-1); the landlord must provide a certificate that the housing is decent (R. 823-2) — the evidence the assessment starts from. The fund’s duty to pay is not among them yet: the right it depends on is still open.
6. The paying body answers: decent
In this example the answer enters the case marked as an answer to a judgment:
assert "al-decence": fr.apl::logement_decent(entity_ref("urn:law:examples:fr:garnier:menage")) { origin adjudicated; }
The marker origin adjudicated admits it through the judgment channel; in this short form the case does not record which body gave it. Now the right is established by the rule DroitOuvert, and a new position appears: the fund must pay the housing aid due to the household (VerserAideTheoriqueDue). The same model, one more answer, and the file moves from “waiting” to “pay”.
7. The paying body answers: not decent
A finding of non-decency does not end the aid. Article L. 843-1 says, in three sentences:
Lorsque l’organisme payeur ou un organisme dûment habilité par ce dernier a constaté que le logement ne satisfaisait pas aux caractéristiques de décence mentionnées à l’article L. 822-9, l’allocation de logement est conservée par l’organisme payeur pendant un délai maximal fixé par voie réglementaire. L’organisme payeur notifie au propriétaire le constat … et l’informe qu’il doit le mettre en conformité … Durant ce délai, le locataire s’acquitte du montant du loyer et des charges récupérables diminué du montant des allocations de logement, dont il a été informé par l’organisme payeur, sans que cette diminution puisse fonder une action du propriétaire à son encontre pour obtenir la résiliation du bail.
In English: for the family and social housing allowances (ALF, ALS), when the paying body — or a body it has accredited — finds the dwelling not decent, the paying body keeps the allowance for a period set by regulation. It notifies the owner of the finding and of the deadline to bring the dwelling up to standard in order to receive the kept sum. During that period, the tenant pays the rent plus recoverable charges, minus the allowance amount the paying body has communicated; that reduction gives the owner no ground to seek termination of the lease.
One article, four different things in the model — a rule, a duty, an amount and an immunity:
- a rule: the allowance is kept (
ConservationDeclencheeALF); - a duty of the fund: notify the owner of the finding (
NotifierProprietaireConstat), alongside its duties to inform the tenant (R. 843-3) and to tell the owner about help with the works (R. 843-4); - an amount: the rent the family pays — €1,320 + €0 recoverable charges − €189.95295, the allowance amount the fund has communicated and the file records as a fact = €1,130.04705 (
LoyerReduitConservation). The file takes that amount from Chapter 4’s calculation, with all its decimals; - an immunity: the household is protected against the landlord ending the lease over that reduction (
NonResiliationBailNonDecence).
In the file, the finding of 28 April 2026 is entered twice — as the negative answer to the decency question, and as the dated finding that starts the conservation:
assert "al-decence": not fr.apl::logement_decent(entity_ref("urn:law:examples:fr:garnier:menage")) { origin adjudicated; }
assert "nd-constat": fr.apl::constat_non_decence(entity_ref("urn:law:examples:fr:garnier:menage"), @2026-04-28) { origin case_input; }
With that answer given, the question “is the right open?” is not established and carries no further request — the authority has answered. And the fund’s duty to pay is absent: the allowance is kept, not paid.
8. What this gives the fund
Arxo makes the pending assessment and its named authority explicit in the answer. The three files show how each answer, with the facts that come with it, changes duties, amounts and protections — with the article behind each one. That clear line between what the model computes and what a person assesses is also what French law asks an administration to explain about an algorithm’s part in a decision (Chapter 13).
9. Where Catala stands on this
Catala, a pioneering law-as-code language, expresses legal conditions and their exceptions beside the text they come from. Its scopes take inputs from the caller, and Catala 1.3.0 offers optional values for a fact that may be absent (Catala book, ch. 5.2) — a condition such as “the housing is decent” can be modelled that way. What its documented language does not have is a dedicated form for a judgment addressed to a named authority, or for the legal duties and immunities that follow; each would be modelling written for the application. Arxo provides these forms directly, in the language and in every answer. For a caseworker, that means the pending assessment, its authority and the resulting positions are visible in the file itself.
10. How the answers were recorded
law ask <case package> --case DecenceEnAttente --query-json queries/droit-ouvert.json
law ask <case package> --case NonDecenceConstatee --query-json queries/positions.json
The third case is DecenceReconnue; the other questions are aide-mensuelle, conservation and loyer-reduit. The case package’s check asks all twelve questions and runs a test twin with the same expectations.
Exercise
- In the file with no assessment yet, what is the status of the right, and to whom does the model address its question?
- Which sentence of L. 843-1 becomes an immunity in the model, who holds it, and against whom?
- Before the assessment, the family asks how much its housing allowance would be. What does the model answer?