A website may need further design work before every material decision is settled. Hiding a pending item to continue a preview is different from erasing the pending state and declaring release readiness. I used the three-state rule in the original work records to build a new small Python module that computes results only from explicit declarations.
Its input is a list of IDs and states, plus preview or release mode. Its output separates visible IDs, declared-absent IDs and pending IDs, and reports whether this particular state gate allows a build. It does not contain an AI that discovers files or establishes facts. The download includes the new code, synthetic example, isolated checks and guide.
Keep the input small and its meaning explicit
The root JSON object contains exactly features and mode. Each feature has exactly id and state; the allowed states are confirmed, absent and pending. Duplicate IDs are rejected rather than guessed at. Unknown states and extra fields also fail the contract. If another project uses a different schema, write an explicit mapping into this contract instead of assuming the module understands that project.
IDs are unique nonempty strings of at most 120 characters. There may be at most 1,000 items, and CLI input is limited to 1 MiB. These bounds do not constitute an internet service security configuration or customer-data anonymization. IDs remain in the output, so public examples must use generic identifiers. The program checks declared structure, not the privacy of a business record.
Hidden output retains the difference between absent and pending
Confirmed items become visible. Absent items remain in declared_absent, and pending items remain in pending. The hidden output groups declared-absent items before pending items while preserving the order inside each group. A shared display result does not collapse their different meanings, and the input records are left unchanged.
Preview passes this gate even with pending material. Release returns can_build false whenever pending remains. An explicitly empty list passes this state gate; it does not approve an empty website or establish overall release readiness. Other required-material and configuration checks must remain in place. The output describes a bounded decision, not a certificate of completion.
Source and a real invocation
The code below is the same new feature_states.py included in the ZIP. It uses the Python standard library and performs no network calls, file discovery, HTML changes or publication requests. Import evaluate_features for an application, or pass JSON on standard input to use the CLI. This is an independently authored implementation, not redistribution of the original customer template.
Inside the extracted folder, run python feature_states.py < example-input.json and run python checks.py for the included checks. Exit 0 means this state gate allows the requested mode, exit 1 means pending blocks release, and exit 2 means invalid input. Automation should read the exit status and the returned states together rather than search for a reassuring output phrase.
Explore the implementation
New standalone Python CLI · declared states only
"""Pure declared-state gate. No discovery, rendering, storage or publication."""
import json,sys
MAX_FEATURES=1000
def evaluate_features(features,mode):
if mode not in ('preview','release'):raise ValueError('mode must be preview or release')
if not isinstance(features,list) or len(features)>MAX_FEATURES:raise ValueError('features must be a list of at most 1000 items')
visible=[];absent=[];pending=[];seen=set()
for row in features:
if not isinstance(row,dict) or set(row)!={'id','state'}:raise ValueError('each feature needs exactly id and state')
ident=row['id'];state=row['state']
if not isinstance(ident,str) or not ident.strip() or len(ident)>120 or ident in seen:raise ValueError('feature IDs must be unique nonempty strings of at most 120 characters')
if not isinstance(state,str) or state not in ('confirmed','absent','pending'):raise ValueError('unknown feature state')
seen.add(ident)
{'confirmed':visible,'absent':absent,'pending':pending}[state].append(ident)
return {'mode':mode,'visible':visible,'declared_absent':absent,'pending':pending,'hidden':absent+pending,'can_build':mode=='preview' or not pending,'scope':'declared states only; no asset/source/rights/operating-site validation'}
def unique_object(pairs):
result={}
for key,value in pairs:
if key in result:raise ValueError('duplicate JSON key')
result[key]=value
return result
def main():
try:
raw=sys.stdin.buffer.read(1024*1024+1)
if len(raw)>1024*1024:raise ValueError('input exceeds 1 MiB')
value=json.loads(raw,object_pairs_hook=unique_object)
if not isinstance(value,dict) or set(value)!={'features','mode'}:raise ValueError('root needs exactly features and mode')
result=evaluate_features(value['features'],value['mode'])
except (ValueError,TypeError,RecursionError,UnicodeError):
print(json.dumps({'error':'invalid feature-state contract'}));return 2
print(json.dumps(result,ensure_ascii=False));return 0 if result['can_build'] else 1
if __name__=='__main__':raise SystemExit(main())
Do not silently overwrite duplicate JSON keys
If a JSON object repeats a key, a parser that keeps only the final value can make a pending declaration appear confirmed. This CLI rejects duplicate keys during parsing. Actual isolated processes check both a repeated root features key and a repeated state key inside a feature. Conflicting declarations should be visible as input errors rather than disappear before evaluation.
Malformed structure, oversized input and excessively deep input also produce a generic contract error. The error does not echo the original material. Normal output still retains the supplied IDs, however, so this mechanism is not a privacy filter. Its parsing boundary and the caller’s responsibilities are separate and need to remain clear when the code is reused.
What remains when connecting it to a real website
A renderer is still needed to change menus, pages and sitemaps. Actual files, factual support, rights and currency must be checked outside this module before a confirmed declaration is made. Absent describes a presentation-material decision, not proof that a real facility or business relationship does not exist. Passing the state gate must not bypass other release conditions.
The twenty-four checks use synthetic state lists and isolated CLI processes. They do not validate an existing customer website, VR execution, booking submission or email delivery. I have kept the reusable responsibility small enough to inspect. A reader can connect this contract to a site-specific navigation model and then test that connection separately, rather than inherit an unexamined promise about the whole site.