Capstone: Bacon's co-stars
# grade this stage (from your course directory)
npx theinference test --stage bacon-costars --watchThe screenshot moment. Run the famous query through your own database, end to end on the real graph. Nothing new to implement — this assembles the whole path (anchor on a real name, DISTINCT across shared movies, ORDER BY on real strings) and catches integration bugs the unit fixtures missed.
Run the co-star query
kgdb query must print the exact co-star table the reference engine prints. The capstone query returns each co-star with the movie they shared, ordered by name then movie:
your_program.sh query {fixture}/fixtures/data/nodes.json {fixture}/fixtures/data/relationships.json "MATCH (bacon:Person {name:'Kevin Bacon'})-[:ACTED_IN]->(m)<-[:ACTED_IN]-(coStar) WHERE coStar.name <> 'Kevin Bacon' RETURN DISTINCT coStar.name AS name, m.title AS via ORDER BY name, via"
name | via
---------------------+----------------
Bill Paxton | Apollo 13
Christopher Guest | A Few Good Men
Cuba Gooding Jr. | A Few Good Men
Demi Moore | A Few Good Men
Ed Harris | Apollo 13
Gary Sinise | Apollo 13
... (Jack Nicholson, Tom Cruise, Tom Hanks, Sam Rockwell via Frost/Nixon, ...)
If a co-star is missing or duplicated, check three things: the anchor found exactly one Kevin Bacon; isomorphism stops the same ACTED_IN being reused (so Bacon isn't his own co-star); and DISTINCT collapses duplicates. The <> predicate is the last guard against self-matches.
Process mode, stdout_json_match against the canonicalized result (ordered, since the query has ORDER BY name, via). This is the same engine that just passed every unit step — now proven end to end on the real graph.