I spent a day turning a Chinese employment rule into code, and the rule that looked simple turned out to be four boundary conditions wearing a trench coat. The rule: after two consecutive fixed-term contracts, the employee can demand a contract with no end date. Everyone quotes that sentence. Almost nobody quotes the counting rules underneath it.
Here is the whole thing as a function, plus the four places where my first implementation was wrong.
The shape of the rule
The Chinese Labour Contract Law, Article 14(2), lists three routes to an open-ended contract:
- ten years of continuous service at one employer;
- ten years of service and fewer than ten years to retirement, for units that were introducing the contract system for the first time or restructuring;
- two consecutive fixed-term contracts, no disqualifying situation, and a renewal.
Route 3 is the one that gets litigated, so in 2025 the Supreme People's Court issued an interpretation (in force 2025-09-01) that says which arrangements count as that second contract. Four, as it turns out.
Boundary 1: "full ten years" is inclusive
The Chinese text says ten years completed — the character 满. Ten years and zero days qualifies; nine years and 364 days does not. My first draft used years > 10, which is off by exactly one day and would have been wrong for the most memorable case: the employee who hits ten years on the last day of a contract, which is precisely when the question gets asked.
def ten_year_route(start, renewal_date): years = (renewal_date - start).days / 365.25 return years >= 10 # 满十年, not > 10 Boundary 2: the counter starts in 2008, not at hiring
Article 97 of the same law says the count of fixed-term contracts runs from contracts renewed after the law took effect on 2008-01-01. A contract signed in 2006 and renewed in 2009 therefore counts as the first counted contract, not the second. Count every contract from the hire date and you will tell people they have a right they do not have yet, or miss one they do.
My first version counted all contracts and produced a wrong answer for anyone hired before 2008. The fix is one filter:
counted = [c for c in contracts if c.is_renewal and c.start >= date(2008, 1, 1)] Boundary 3: an 11-month extension is not a contract
This is the part the 2025 interpretation added, and it is where the arithmetic gets sharp. Article 10 says four things count as the second contract:
- negotiated extensions adding up to one year or more, once the extended term expires;
- a contractual auto-renewal clause, once the renewed term expires;
- a swap of the contracting entity where the workplace and post stay the same and management continues;
- other evasions contrary to good faith.
"One year or more" is inclusive. Two six-month extensions reach twelve months and count. Eleven months does not. A single three-month extension never gets close.
def extension_counts(months): # list of agreed extension lengths return sum(months) >= 12 # 一年以上 includes exactly twelve This matters because an extension of a fixed-term contract used to be the cheapest way to keep someone on rolling short terms without ever reaching the second contract. The threshold is the fix, and the threshold is also the bug surface: every extension has to be logged with its length, or the counter cannot be computed at all.
Boundary 4: partial years round in the employer's direction, then cap
When the refusal happens and money changes hands, the severance base is the average of the last twelve months. Partial service rounds up: six months or more counts as a full year, under six months as half a month.
def counted_years(years, months): return years + (1 if months >= 6 else 0.5 if months > 0 else 0) Then the cap: if the monthly wage exceeds three times the local average, the base drops to that three-times figure and the counted years stop at twelve. Fourteen years at a high wage pay as twelve.
def severance(years, months, wage, local_avg=None): n = counted_years(years, months) base = wage if local_avg and wage > 3 * local_avg: base = 3 * local_avg n = min(n, 12) return n * base Unlawful termination doubles that number — and the doubled sum replaces severance rather than stacking on it, which is one of those details that changes a total by a factor of two.
The sourcing hierarchy is the real lesson
Four documents, four different weights, and mixing them up is how legal writing goes wrong:
| Layer | What it does | How I used it |
|---|---|---|
| statute | sets the rule | Article 14, 47, 82, 87, 97 |
| State Council regulations | fills in arithmetic | the 11-month double-wage window; the 10.5-month rounding |
| SPC interpretation (2025) | says what counts | the four extension cases; the one-month window after expiry |
| SPC commentary | explains intent | "the employer no longer has a choice" — not binding text |
That last row is the trap. The sentence everyone repeats — after two contracts the employer has no choice about renewing — appears in the court's published commentary, not in the interpretation's articles. It is the clearest statement of how the clause is read, and it is still commentary. I quoted it on the site and labelled it as commentary. A programmer would call this a comment that explains the intent of code you cannot change.
Two more things that cost me time
Formally repealed versus superseded. The 2025 interpretation's final article repeals one paragraph of the 2020 interpretation by number, then adds a catch-all: earlier interpretations yield where they conflict. The 2020 Article 34 — the one that let either side walk away when a contract expired and work continued — is not named. The commentary says it is abolished all the same. So the honest sentence is "abolished in effect, not by citation", and that is the sentence I published.
Court servers do not like scripts. One court portal returned HTTP 449 through my proxy and 200 on a direct connection two minutes later. A 449 is not a dead link and not a 404; it means the WAF wants a different client. Treating it as "source gone" would have deleted a source that a browser opens fine.
The case that keeps the rule honest
Among the cases released with the interpretation there is one where an employee on a five-year contract refused repeated requests to renew, said he could claim double wages if there was no contract, and then claimed exactly that. The court refused: the double-wage rule does not protect the party who engineers the omission.
That case is why the function above cannot be the whole answer. Every boundary I encoded assumes a good-faith timeline. The moment one side manufactures the gap, the arithmetic stops being the point.
I wrote the long version — clause by clause, with the four counting rules, the cost table and the disagreements between the texts — at China's open-ended contract: ten years, or two renewals. The functions above are the same assertions I used to check my own arithmetic before publishing.
Drafted with an AI assistant from my own reading of the primary documents; every clause number and link here was checked against the source.