if the knee is extend in stance phase, hamstrings muscles works as "knee extensors". But when in swing phase, that is, when the foot is flying, hamstrings works as "knee flexors". Thus, it depends if the foot is or not bearing the body mass. Good luck!
To my knowledge muscle work is considered as negative if it inhibits motion (breaks or stores energy).
In stance phase in of walking the quadriceps muscle stabilizes stance by inhibiting excessive knee motion (keep the leg straight), especially during stance phase flexion. As muscle force (and the corresponding moment) acts against the motion work is considered negative.
A good examle is walking down stairs or slopes: The quadriceps is active to break and prevent you from falling down although in general (potential) energy is dissipated. The muscle performs negative work and you can feel it after a while of walking down slopes...
The initial phase of stance in gait is characterized by a small amount of knee flexion before the joint extends through mid stance. During the initial flexion, the quadriceps acts eccentrically to absorb force (i.e. they work negatively during this phase).
At the end of the swing phase the quadricps is active when the heel is no the ground in an eccentric contraction , that amount of contraction stay at the stand phase almost equal till the mass of the body is over the foot than the relaxation comes.
Negative means therefore eccentric but very important in the weight bearing function and movement fluctutation
I think that because quadriceps in this phase will start to be in eccentric mode to control knee flexion which is going to start as soon as leg complete knee extension, All ambulation sub-phases occurs in continuous way, and each sub-phase will prepare for next sub-phase.