Urgent.News

What's breaking now, across hundreds of outlets.

Tech

Turning a Chinese open-ended contract rule into code: four boundary cases

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…

In a day-long effort to translate a seemingly simple Chinese employment rule into code, it became apparent that four boundary conditions were at play. The rule states that after two consecutive fixed-term contracts, an employee can demand an open-ended contract. However, the counting rules underneath are not as straightforward.

The Chinese Labour Contract Law, Article 14(2), outlines three ways to obtain an open-ended contract. The third and most litigated route involves two consecutive fixed-term contracts, provided there are no disqualifying circumstances and a renewal. However, the interpretation from the Supreme People's Court in 2025 clarified which arrangements count as the second contract.

Four boundaries emerged from the analysis. First, the term "full ten years" is inclusive, meaning ten years and zero days qualify as ten years. Boundary two highlights that the counting of fixed-term contracts starts from 2008, not from the date of hiring. This revelation caused issues in the initial implementation, as it led to incorrect results for employees hired before 2008.

Boundary three introduced a new rule: an 11-month extension does not count as the second contract, even though it is close to the 12-month threshold. Boundary four addresses partial years, where any service of six months or more is counted as a full year. However, the severance base is capped at three times the local average wage, and the counted years cannot exceed twelve.

The four documents involved in this process—statutes, State Council regulations, the Supreme People's Court interpretation, and commentary—each have their own weight and should be used accordingly. The Supreme People's Court interpretation is not binding text, but rather an explanation of how the clause is read. This distinction is crucial, as it appears in the commentary rather than in the interpretation itself.

The lesson learned from this exercise is that legal writing can be complex, with multiple layers and potentially conflicting interpretations. It is essential to carefully source and understand the different materials and to properly attribute commentary. Additionally, when working with court servers, unexpected issues like HTTP 449 errors may arise, requiring a more diligent approach to accessing the necessary documents.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in Tech

Zero-downtime credential rotation in OpenTofu: the two-phase pattern (and the two bugs it taught me)

Rotating a long-lived credential sounds trivial: create a new one, hand it out, delete the old one. In practice "hand it out" is never instant.

  • Implement two-phase pattern for zero-downtime credential rotation in OpenTofu
  • Phase 1 and Phase 2 slots alternate with overlap window (W) of credential lifespan (E)
  • Three resources manage timeline: locals, cycletimer, and deterministictime

Artalk site isolation and admin credentials define a comment control plane

Artalk site isolation and admin credentials define a comment control plane Artalk is a self-hosted comment system with social login, site isolation, moderation, an administrator dashboard, and an HTTP…

  • Artalk is a self-hosted commenting system with social login and moderation features
  • Each installation hosts comments for multiple sites via site key
  • Administrators must secure appkey with strong, unique credentials

Does Deleting Object Keys Still Kill Performance? I Tested It

I tested the old advice that deleting object keys wrecks lookup speed, on Node 22, with 100,000 entries A plain object stayed faster than a Map before, during and after five delete-and-rebuild cycles…

  • Deleting keys from plain objects remains faster than Maps in current JavaScript engines
  • "Dictionary-mode" slowdown claim disproven by performance improvements in objects
  • Maps slowed to 15.8ms from 16.2ms during key deletion churn, while objects sped up

More from Sunday 22 November →